foreach (Parameter p in e.Parameters)
the above statement in your loop will call the parameters each time from the element and will not iterate to go through one by one. this will cause that some of the parameters might be missed, for that reason I used this statement
var bips = Enum.GetValues(typeof(BuiltInParameter));