[Mono-list] C# questions

Juan Cristóbal Olivares jc.olivares@pad.cl
Mon, 8 Nov 2004 12:17:46 -0300


2.-

if (someObjet is someType)
{
    ....
}


----- Original Message ----- 
From: "Kevin White" <jedirunner@gmail.com>
To: <mono-list@lists.ximian.com>
Sent: Monday, November 08, 2004 12:13 PM
Subject: [Mono-list] C# questions


> 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
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list