开发者

is there a way to declare a group of members with the same accessor in c#?

开发者 https://www.devze.com 2023-02-19 01:27 出处:网络
i have this basic question : is there a way to declare a group of members with开发者_Python百科 the same accessor in c#?, something like \"accessor:\" of c++ that specify that from that line downward

i have this basic question : is there a way to declare a group of members with开发者_Python百科 the same accessor in c#?, something like "accessor:" of c++ that specify that from that line downward every member have this accessor

Edit: with "accessor" i mean access-specifier like public, private, protected, etc.


I think you meant access-specifiers. If so, then no. You cannot do that in C#, like you do in C++.

However, if it's private, then you can omit it altogether, because by default, everything (fields, properties, methods) in C# is private.


No. C# does not have this feature.

However, if you Alt-Shift-Drag in Visual Studio 2010, you can type it all at once.

See this video: http://scottcate.com/tricks/503/

0

精彩评论

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