开发者

is the c# compiler exentisble?

开发者 https://www.devze.com 2023-02-23 14:15 出处:网络
Is there any way to add your own language extension? For example make it so: public string Foo { get开发者_开发百科; set; }

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消