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/
精彩评论