[Mono-list] C# questions

Kevin White Kevin White <jedirunner@gmail.com>
Mon, 8 Nov 2004 08:13:13 -0700


Hi all,  I have a couple C# questions:

1- How do I determine if a delegate's invocation list contains a
particular method?  It appears that a method can be added to a
delegate's invocation list multiple times, though it will only be
invoked once, based on its first insertion point in the invocation
list.  Removing the delegate (i.e.: using the - or -= operator) will
remove the last occurance in the invocation list.  But what if more
occurances of the particular method are in the invocation list?  How
do I check that I've removed them all?

2- What is the c# equivalent of this java code (assume that the
instance referenced by Object o is actuall a Button):

if(o instanceof Button){  // code here}

I assume the equivalent of that will also work for interfaces as in:
(assume the instance referenced by Object o is an instance that
implements ICloneable):

if(o instanceof ICloneable){ // code here }

How do I do that type of type checking in C#?

Thanks,

Kevin
-- 
Kevin White
jedirunner@gmail.com