C# Add method to system class

Associate
Joined
1 Feb 2006
Posts
1,868
Location
Reading
Is it possible to add my own method to say the Array system class?

If so how would i go about doing it? can't seem to find anything explaining on t'internet.
 
You can do it by creating a new class which 'extends' the Array Class.

Code:
class MyArrayClass: Array
{
    public aNewMethod() { 
        blahh; 
    }
}

That way the new class will contain all of the Array methods, plus any new ones you make.
 
Back
Top Bottom