المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Creating a method hierarchy within a class



C# Programming
11-08-2009, 05:50 PM
I have been searching all over for an answer, but I have fallen back to asking the programming geniuses that frequent this site.

I am looking into a way to call different methods within a class. The problems are, in the class there are lots of methods and many of the methods are similar in function. So I am looking for a way to put the methods in a hierarchy within the class, but namespace can't be called within a class.

Hopeing for the class to resemble something like:
namespace IEWindow
{
public class Main
{
public void Method()
{
}

public ... NavigationBar
{
public void Method()
{
}

public ... Forward
{
public bool Method()
{
}
}
public ... Back
{
//methods
}
public ... AddressBar
{
//methods
}
}
}
}
*Note, in reality this will contain as many as a few hundred methods;

and to be used like
IE********Main IEWin = new IE********Main();
IEWin.Method();
IEWin.NavigationBar.Method();
bool g = IEWin.NavigationBar.Forward.Method()

Any help, even a statement like 'This is impossible, but thanks for humoring me', would be greatly appreciated.