|
-
July 4th, 2010, 06:14 AM
#1
XML serialization based on a node's attribute
I'm trying to code a couple of tools to manage Visual Studio's projects. The reason why I need an external program for that is that 1) I use VS Express, so I have no macro support, and 2) it may be useful to perform similar operations on VS and non-VS projects.
The first thing I though about when I needed to model a VS project was to use c#'s XML serialization to load and save the project. But the vcproj file (C++ project file) has configurations that are defined like this:
Code:
<Configuration
Name="Debug|Win32"
OutputDirectory="..\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
...
If I associate the "Tool" XmlElement to a certain class, I am not able to differentiate between the different type of tools. What I would need is to differentiate the classes the element is serialized/deserialized to/from based on the element's "Name" attribute, but I haven't found anything about how to do this.
Can anybody please give suggestions? Thanks.
I owe Paul McKenzie a pizza.
I am no expert; but they say I can make concepts easy to understand. That's why newbies questions are mine!!! XD
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
|