CodeDom

  • Thread starter Thread starter 2G
  • Start date Start date
2

2G

Hello

Can anyone tel me how to do this :

System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler =
new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);

this.Tables.CollectionChanged += schemaChangedHandler;

this.Relations.CollectionChanged += schemaChangedHandler;



ps, if anyone knows some good tutorials about CodeDom, please post or mail
the link, I'm having a very hard time finding what everything is.



thanks
 
This seems to do the trick, Am I doing it right ?

ccs.Statements.Add(

new CodeVariableDeclarationStatement(

typeof(System.ComponentModel.CollectionChangeEventHandler),
"schemaChangedHandler",

new
CodeObjectCreateExpression(typeof(System.ComponentModel.CollectionChangeEven
tHandler),

new CodeFieldReferenceExpression(new CodeThisReferenceExpression(),
"SchemaChanged"))));
 
Still problems with the last 2 lines.

The only thing I get out of it is :

this.Tables.CollectionChanged += this.schemaChangedHandler;
 
Back
Top