Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parse C# designer.cs and modify?
Message
De
28/08/2009 12:40:20
 
 
À
24/08/2009 03:52:09
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01420050
Message ID:
01421523
Vues:
56
>Don't do it.
>Well there's no harm in it as long as you recognize that if you make a subsequent change to a form in the designer the design.cs code is COMPLETELY regenerated


Yes, Viv, that's the general rule of thumb, but it all depends on WHAT it is you've changed. As Tracy found out, that particular change didn't hurt anything, and her change was propagated into the regenerated code.

~~Bonnie




>>Update: It worked and didn't seem to break it :o)
>>
>>
>>
>>(Sorry, this is a Duplicate Post)
>>
>>Ok, the general rule is to leave the designer.cs file alone. However, the only thing I want to edit is the BoundProperty value on my controls. I am redoing a VFP form of 32 pages and each page has approximately 10-30 controls on it so updating the bound property on every page is very time consuming. Right now, the form has old variables in the boundproperty and I need to update every one with the new dotnet variable name. So, I want to parse the file and find:
>>
>>this.pgGenProp1.BoundProperty = "glMyVarName";
>>
>>and take the value glMyVarName, find it in a table, and replace it in the designer.cs file with "MyNewVarName" programmatically.
>>
>>I have a table with the old vars and the new vars.
>>
>>Can I do it? Has anyone done that before? As long as I don't touch anything else, is it reasonable for it not to break?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform