views:

75

answers:

3

Is there a setting to change where all new classes I create will automatically be Public instead of Private? I thought I remember somebody saying that you can modify a template file, but I have no clue where to look.

+3  A: 

See this answer

Just to bring the information closer to the question, see the following taken from here:

I first edited the Class.cs file inside the C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip package and added the public modifier to the class.

This didn't work.

I then found this folder: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\1033\Class.zip and did the same addition on the Class.cs file in this folder and it worked.

Marc
A: 

If you're using the wizard, I think you can specify if a member is suppose to be private or public.

As for defaults, I'm thinking that's up to the language specifications on visibilities of members. If you modify it so that it's always public or private, you can lose portability of your code even if it's system dependent.

Daniel
A: 

If you're talking about the class code snippet, which you can change by going into Tools -> Code Snippet Manager.

Joseph