Is there any way to add your own language extension?
For example make it so:
public string Foo { get开发者_开发百科; set; }
can be coded as:
public auto string Foo;
No, but you can just type
prop
in Visual Studio, press Tab (maybe twice), and voilà! You get what you wanted. :D
Nope - you can't extend the C# compiler in this way.
You should be thankful it's that short, you used to have to write:
public string Foo
{
get
{
return this.foo;
}
set
{
this.foo = value;
}
}
private string foo;
精彩评论