I have the following class structure:
public abstract class PresenterBase { public static Dictionary<string, MethodInfo> methodsList; public void Bind() public void Initialize(); } public class DevicePresenter: PresenterBase { public void ShowScreen(); public void HandleEvents(); } public class HomePresenter: PresenterBase { public void ShowScreen(); public void HandleEvents(); }
I want HomePresenter and DevicePresenter to have a separate copy of the staticList of the static member defined in PresenterBase.
Unfortunately, they use the same copy with the above implementation.
Are they an alternative approach that I can have a separate copy of the List methods for HomePresenter and DevicePresenter? I do not want to define the List methods in derived classes, because in the future, if someone adds another derived class, he will have to keep in mind adding the List methods to this class.
source share