开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜