I am creating an app that exports .fdp files using serialization. I have run into a small problem. event is a keyword in c# so I am looking for ideas as to how I can define a class named "event" that I can pass to the serializer.
- carsonfee asked 10 years ago
I think I found a couple of nifty solutions. One is to use the @ in front of the name which flags it as a string to the serializer and keeps the compiler happy, so the class deffinition is @event instead of just event.
The other super handy tool I found is xsd.exe, I have used this sparingly in the past but it is amazingly powerful when you get the hang of schema creation. Here’s a simple example:
- rename a project.fdp to project.xml
- run xsd on it, this will create a schema named project.xsd that you can visuallly edit in vis studio
- run xsd again with a few arguments -l:c# /c namespace:(yournamespace) project.xsd (your using the schema file this time, not the xml)
- kapow! you should now have a shiny new .cs file with all of your classes and types with which you can create designer project files!!
- carsonfee answered 10 years ago
Please login first to submit.