InsertBefore Problem


I have a strange problem with InsertBefore. I have a custom collection which is derived from Hashtable. I store some GoObjects in this and then pass the relevant one to InsertBefore. When I do I get the following error:

Unable to cast object of type ‘System.Collections.DictionaryEntry’ to type ‘MSL.MAKE.PL.WorkflowEditor.FlowControlDecorator’.

If I override InsertBefore and check the values being passed in the child is a GoRectangle and the newobj is a FlowControlDecorator as expected. The call to base.InsertBefore then produce the message above. As I have no access to the source for the InsertBefore method I was wondering if anyone could shed some light on this.

If I make InsertBefore a no op I don’t get the error.



forget about this. problem is in my code. error is produced in my LayoutChildren.