Creating C# files
-
I'm trying to develop an application wherein I have an XML file. The contents of this XML file should be dynamically converted into a C# class(with properties). I learnt when the contents of a C# file ie properties are given to Microsoft property grid in .NET, all the fields in the grid are populated with the C# class properties. Could the classes that you have mentioned be of any use to my application. I was exploring the idea of developing a wizard in VC8 that should address this situation. I have many xml files and the point here is that I want a generic application to do this job. The whole idea behind the above design is to show xml data to the user and when the user edits the data from the grid the xml file gets updated. Any comments are highly appreciated. Thanks
-
I'm trying to develop an application wherein I have an XML file. The contents of this XML file should be dynamically converted into a C# class(with properties). I learnt when the contents of a C# file ie properties are given to Microsoft property grid in .NET, all the fields in the grid are populated with the C# class properties. Could the classes that you have mentioned be of any use to my application. I was exploring the idea of developing a wizard in VC8 that should address this situation. I have many xml files and the point here is that I want a generic application to do this job. The whole idea behind the above design is to show xml data to the user and when the user edits the data from the grid the xml file gets updated. Any comments are highly appreciated. Thanks
Use the System.Xml.Serialization.XmlSerializer to serialize a class instance to an XML file and back again.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Goof around music jam with my brothers (with video) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
I'm trying to develop an application wherein I have an XML file. The contents of this XML file should be dynamically converted into a C# class(with properties). I learnt when the contents of a C# file ie properties are given to Microsoft property grid in .NET, all the fields in the grid are populated with the C# class properties. Could the classes that you have mentioned be of any use to my application. I was exploring the idea of developing a wizard in VC8 that should address this situation. I have many xml files and the point here is that I want a generic application to do this job. The whole idea behind the above design is to show xml data to the user and when the user edits the data from the grid the xml file gets updated. Any comments are highly appreciated. Thanks
As far as I know property grid does not take C# file. It takes object of a class and populates itself with the properties of the object. Since you have XMLs ready, serialization wont help you in easy way. You would need to follw these steps.. - Design a serializable class with the same structure as your XML file. - Parse XML for the first time to populate an object of that class. - pass that object to the PropertyGrid - Serialize the object to an XML file when user wants to save it. - Use this XML file in the future not the original one. Which would make you enable to directly deserialize the file into an object instead of parsing it. This may not be the best possible way but... Every bit counts ADD
-
I'm trying to develop an application wherein I have an XML file. The contents of this XML file should be dynamically converted into a C# class(with properties). I learnt when the contents of a C# file ie properties are given to Microsoft property grid in .NET, all the fields in the grid are populated with the C# class properties. Could the classes that you have mentioned be of any use to my application. I was exploring the idea of developing a wizard in VC8 that should address this situation. I have many xml files and the point here is that I want a generic application to do this job. The whole idea behind the above design is to show xml data to the user and when the user edits the data from the grid the xml file gets updated. Any comments are highly appreciated. Thanks
-
Use the System.Xml.Serialization.XmlSerializer to serialize a class instance to an XML file and back again.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Goof around music jam with my brothers (with video) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
Thanks for the reply, but if I have to develop something like a wizard in VC2005, then what changes do I ought to do. basically the thing is that we do have a whole lot of ini files aand at any moment we can have a situation to change an ini file. This neccesitates generation of a tool whcih is genric enough to handle the operatio. Each ini file is unique and is supposed to have a unique C# class for it. The wizard whould be capable enough to convert the XML data to C# file. The above discussion is based on the fact that I have a way to convert ini file to XMl or is there any better way lets say directly pass the ini field to the wizard.