I'm very new to C# and currently I'm using this way to always use the same instance:
public class Sample{
private Sample(){
//initialize sth.
}
private static Sample _instance;
public static Sample Instance{
get{
if(_instance == null)
_instance = new Sample();
return _instance;
}
}
}
Do you know a better way because it doesnt seem quite object-orientated to me...