|
-
Apr 26th, 2006, 02:58 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [1.0/1.1] Default Class Scope
Does anyone know if there is a way to change the default class scope and constructor scope when creating a new class? 90% of my classes are internal, so I have to change the scope from public to internal and the default constructor every time. Just a small annoyance but an annoyance non the less.
-
Apr 26th, 2006, 03:16 PM
#2
Re: [1.0/1.1] Default Class Scope
dont think this is possible. You're just gonna have to change them to internal manually 
Woka
-
Apr 26th, 2006, 03:26 PM
#3
Thread Starter
Hyperactive Member
Re: [1.0/1.1] Default Class Scope
Bloody annoying little thing, bugs me every time. How many people need public classes all the time? Internal has to be the most common scope.
-
Apr 26th, 2006, 05:56 PM
#4
Re: [1.0/1.1] Default Class Scope
I'm sure that you could create a VS macro to do it, although I have next to no experience with IDE macros so I couldn't give you any details.
-
Apr 28th, 2006, 03:31 AM
#5
Thread Starter
Hyperactive Member
Re: [1.0/1.1] Default Class Scope
Am I the only person who thinks that internal should be the default scope for new classes and their default constructor?
-
Apr 28th, 2006, 03:56 AM
#6
Hyperactive Member
Re: [1.0/1.1] Default Class Scope
Here is what you can do:
Browse in your explorer to:
C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddClassWiz\Templates\1033
Open the File "NewCSharpFile.cs" A Text Editor would do just fine.
Modify to your needs.
Save.
Close and reopen VS.
Now everytime you add a new Class, your new File will be the template for it.
You might want to save the original File somewhere, just in case you screw up !
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Apr 28th, 2006, 07:25 AM
#7
Thread Starter
Hyperactive Member
Re: [1.0/1.1] Default Class Scope
Thanks a lot, that's it sorted.
-
Apr 28th, 2006, 03:36 PM
#8
Re: [RESOLVED] [1.0/1.1] Default Class Scope
Nice one Sgt Onion 
That's very very cool to know...more annoying that the class scope is adding/removing default comments too. imo.
Woooooof
-
Apr 28th, 2006, 07:56 PM
#9
Re: [1.0/1.1] Default Class Scope
 Originally Posted by GlenW
Am I the only person who thinks that internal should be the default scope for new classes and their default constructor?
I agree that the default scope for classes should be internal, but once the class is internal it doesn't matter if its members are public. You can't access a public member of a class you can't see, so a public constructor of an internal class is inaccessible from outside the current assembly.
Nice info Sgt-Peppa. I think I'll have a look for the VB equivalent too.
-
Apr 29th, 2006, 04:22 AM
#10
Thread Starter
Hyperactive Member
Re: [1.0/1.1] Default Class Scope
 Originally Posted by jmcilhinney
I agree that the default scope for classes should be internal, but once the class is internal it doesn't matter if its members are public. You can't access a public member of a class you can't see, so a public constructor of an internal class is inaccessible from outside the current assembly.
Yes, I know, I did say it was a small annoyance, but I'm just a pedant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|