Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Must all forms of a project have same namespace?
Message
 
 
À
18/01/2010 16:42:14
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01444221
Message ID:
01444632
Vues:
30
>>>>Hi,
>>>>
>>>>I have a project that has MainWindow and a couple of forms. The forms are called from the menu of the MainWindow form. After I manually changed namespace of forms things stopped working. Do I have to make sure that all forms of the project must have the same namespace? (or maybe something else caused the problem).
>>>
>>>You can have different namespaces with no problem. When you change them manually, just don't forget the partial classes that are generated by the design system. You need to change them there as well. Then of course depending on how you named them, you would have to have the using statements when you reference them from somewhere else.
>>
>>With all the slick things VS does for you, it's kind of surprising the partial classes don't get cleaned up automagically, isn't it? Oh well. VS is such a sensational IDE it's petty to complain about petting little things like this. We're a long ways from command line compiles, Toto ;-)
>
>Sometimes it is all in how you do the rename. Typically if you right click the file in the solution explorer and pick rename, it will rename the class along with the partial class. If on the other hand you just change the name in the class itself you are on your own to rename the partial class and the constructor.
>Tim

Tim,
I understand your point about renaming a class. But isn't it true that the only way to change a namespace of a class (like a form class) is to manually change it?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform