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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top