Is it possible to call a non-static function that uses a public non-static class inside a static function in C#?
public class MyProgram
{
private Thread thd = new Thread(myStaticFunction);
public AnotherClass myAnotherClass = new AnotherClass();
public MyProgram()
{
thd.Start();
}
public static void myStaticFunction()
{
myNonStaticFunction();
}
private void myNonStaticFunction()
{
myAnotherClass.DoSomethingGood();
}
}
Well, the invalid code like above is what I need.
Any idea?