当我定义一个包含一个只写属性的接口: public interface IModuleScreenData
{
string Name { set; }
}
,并试图(天真)明确有意向实现它的属性也有可公开获得的getter: public class ModuleScreen : IModuleScreenData
{
string IModuleScreenDat
我无法覆盖显式实现接口的方法。 我有两个类。一个名为OurViewModel的基础文件和一个名为MyViewModel的继承文件。他们分享了一个名为Validate方法,直到最近我才得以隐藏方法的基础版本,像这样: public class OurViewModel
{
public bool Validate(ModelStateDictionary modelState){ ret
我有一个情况,其中两班(从另一个推导)都实现明确的相同的接口: interface I
{
int M();
}
class A : I
{
int I.M() { return 1; }
}
class B : A, I
{
int I.M() { return 2; }
}
从派生类执行I.M(),我想调用基类的实现,但我不知道该怎么做。我试过
代码: public interface IFoo
{
void Bar();
}
public class FooClass : IFoo
{
/// <summary> ... </summary>
/// <seealso cref="?"/> //How do you reference the IFoo.Bar() method
publ