I've implemented a singleton class and keep getting the warning that a method I'm writing is a 'new protected member declared in a seal class.' It's not affecting the build but I don't really want to ignore the warning in case it causes problems later on? I understand a sealed class is a class that cannot be inherited - so it's methods cannot be overridden, but I still don't get why the following code would give me the warning (is it due to the use of the singleton design?):
namespace WPFSurfaceApp { public sealed class PresentationManager { PresentationManager() { } protected void MethodName() { } public static PresentationManager Instance { get { return Nested.instance; } } class Nested { // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit static Nested() { } internal static readonly PresentationManager instance = new PresentationManager(); } } EDIT: The warning is regarding MethodName() method. EDIT: Change public void MethodName() to protected void MethodName()
Nestedclassprivate?