Get Calling Class type in base clases static method.

P

parez

Hi All,

How do you think i can get this to work..



Der1.GetCallingClassType() should return Der1




public class Base
{

Base()
{}

public static string GetCallingClassType()
{

//how do i set the value for str
return str
}

}


public Der1:base
{
Der1(){}

}

public Der2:base
{
Der2(){}

}
 
J

Jon Skeet [C# MVP]

parez said:
How do you think i can get this to work..

Der1.GetCallingClassType() should return Der1

You can't. The above line will be compiled to
Base.GetCallingClassType().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top