[英]How can I prevent the generated implementation of an interface from using a type alias?
I'm currently using Visual Studio (specifically, 2012 Express). 我目前正在使用Visual Studio(特别是2012 Express)。 I have an interface already defined as follows: 我有一个接口已经定义如下:
interface IMyInterface
{
public String Data { get; set; }
}
If I have an empty class: 如果我有一个空类:
class MyClass : IMyInterface
{
}
And I right-click on the IMyInterface
, I can select "Implement Interface". 我右键单击IMyInterface
,我可以选择“实现接口”。 When I do this, the auto-generated code produces the following: 当我这样做时,自动生成的代码产生以下内容:
class MyClass : IMyInterface
{
public string Data
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
}
My question is, is there a way that I could have the following auto-generated: 我的问题是,有没有办法可以自动生成以下内容:
public String Data
Instead of: 代替:
public string Data
? ?
There is no way to do this. 没有办法做到这一点。 It's hard-coded to use the builtin aliases where possible. 在可能的情况下使用内置别名是硬编码的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.