I have a class shared( staticin C #) that basically contains some settings data that any class in an application can read and sometimes write. There are also some static properties that contain some internal states.
Now I want to return this class to the initial stage. With all default variables, etc. Suppose the user wants to reset the current state and start without restarting the application.
In a singleton model, I would just update it like this:
Public Sub Reset()
_Instance = New MyClass()
End Sub
However, this is not possible in the classroom shared. Are there any ideas on how I can do this? Or do I need to switch back to Singleton?
source
share