A
Andrew Ducker
I want to make a whole bunch of classes into singletons. They all
descend from a base class.
I'd like to have code in the base class along the lines of :
private This(){ }
private static readonly This instance = new This();
public static This Instance
{
get
{
return instance;
}
}
but there's no way to get the type of the current class and use that
as the equivalent of a generic.
Any suggestions?
Andy
descend from a base class.
I'd like to have code in the base class along the lines of :
private This(){ }
private static readonly This instance = new This();
public static This Instance
{
get
{
return instance;
}
}
but there's no way to get the type of the current class and use that
as the equivalent of a generic.
Any suggestions?
Andy