[Mono-list] C# questions

Mike Welham mike@digitalnova.co.za
Mon, 8 Nov 2004 17:28:31 +0200


> ...  How
> do I check that I've removed them all?

There is a static method System.Delegate.RemoveAll(Delegate source, Delegate
value) that should do that for you. 

> 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}

if(o is Button) { /*...*/ }

there is also:

Button b = o as Button

which is equivalent to:

Button b = (o is Button)? (Button) o : null;