From: Vadim Z. <vz...@ze...> - 2010-12-09 01:08:50
|
Hello, Is it possible to set a method modifier for a property definition in C#? I have a (admittedly strange) situation when a property is defined as being read-only in the base class but read-write in a derived class and while redefining it as such works fine, it results in C# compiler warnings about hiding the inherited read-only property declaration. This warning would normally be fixed by using %csmethodmodifiers "new" but this doesn't seem to work (although from reading Source/Modules/csharp.cxx it looks like it ought to, in spite of its name -- maybe I'm just using it wrong somehow?). So is %csmethodmodifiers supposed to apply to the property declarations and, if yes, how should it be used for them? Alternatively, can anyone suggest some other work around for this warning? Thanks, VZ |