Capture Add method of System.Collections.IList
2 posts • Page 1 of 1
Capture Add method of System.Collections.IList
Hello forum,
I'm developing a framework, and I need to capture the Add method of all System.Collection.IList objects. How Can I capture them? Imagine that the Aspect attribute is "AddingCollectionItemAttribute".
Thanks for all. I will appreciate a lot some help.
I'm developing a framework, and I need to capture the Add method of all System.Collection.IList objects. How Can I capture them? Imagine that the Aspect attribute is "AddingCollectionItemAttribute".
Thanks for all. I will appreciate a lot some help.
- jeusdi2
- Posts: 1
- Joined: Wed Apr 23, 2008 11:37 am
- Full Name: Jordi Cabré
- Company: None
Re: Capture Add method of System.Collections.IList
Hi,
You can use OnMethodInvocation and apply it to IList.Add, but you should be aware that it will ONLY hook explicit calls of this method. It would not hook, for instance List<>.Add, even if it is an implementation of that semantic.
Another limitation is that it catches only calls done in the current assembly. So not indirect calls.
Gael
You can use OnMethodInvocation and apply it to IList.Add, but you should be aware that it will ONLY hook explicit calls of this method. It would not hook, for instance List<>.Add, even if it is an implementation of that semantic.
Another limitation is that it catches only calls done in the current assembly. So not indirect calls.
Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 673
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
2 posts • Page 1 of 1