Hi,
delegates are immutable, you cannot change their contents, only create new
instances. The Delegate.RemoveAll method will remove all occurances of the
specified delegate from the provided delegate and return you a new delegate
instance. So in your example you want to be using the return value from the
RemoveAll method.
Thanks
Mark.
--
http://www.markdawson.org
"Lubomir" wrote:
> Hi,
>
> I am wondering how I could clear the invokation list of delegates.
>
> I tried the following:
>
> //make a chain
> MyDel += SomeDel;
>
> // Clear the chain
> Delegate [] tmp = MyDel.GetInvocationList();
> Delegate.RemoveAll(MyDel, tmp[0]);
>
> Nothing (not even one delegate) is removed from the list.
>
> What am I missing?
>
> Thanks,
> Lubomir
>
>
>