0
有什麼方法可以添加自己的語言擴展?是c#編譯器可執行文件嗎?
例如使它這樣:
public string Foo { get; set; }
可以被編碼爲:
public auto string Foo;
有什麼方法可以添加自己的語言擴展?是c#編譯器可執行文件嗎?
例如使它這樣:
public string Foo { get; set; }
可以被編碼爲:
public auto string Foo;
沒有,但你可以在Visual Studio中鍵入
prop
,按Tab鍵(也許兩次) ,瞧!你得到你想要的。 :D
都能跟得上 - 你不能用這種方式延長C#編譯器。
你應該感謝它的短,你曾經有過這樣寫:
public string Foo
{
get
{
return this.foo;
}
set
{
this.foo = value;
}
}
private string foo;