0

I'm making a converter from SSRS to Telerik Reporting and then using reflection to write out the source code of the .Designer.cs file.

I'm reading the CodeDom attributes with Reflection to control the output, but is there any way to invoke CodeDom to do the serialization from the given object in Memory?

How to I invoke CodeDom serialization?

Do I need to create an DesignerHost for WebForms? Do I need to create a DesignerSerializationManager and how? If I can serialize the Report, will it transverse the CodeDom if visibility is CONTENT or do I have to do this manually?

In short, I want to programmatically regenerate the Designer.cs from an object in memory. http://labs.kaliko.com/2010/10/regenerate-aspxdesignercs-file.html

Thanks

Steve
  • 1,995
  • 2
  • 16
  • 25
  • I think that depends a lot on what kind of objects do you have. For example, if all your types have default constructors and public setters for all properties, that would make things much easier than trying to figure out the correct constructor overload etc. – svick Nov 21 '12 at 21:09
  • I created a method to match public writable properties with the best constructor signatures (weighted-guess) with great success with also adding additional property setters inline. Using "Serialize((dyanmic)item)" also allows me to create Type specific serializes to account for more complex types where I create a local variable with multiple properties before I add it to a collection. – Steve Nov 22 '12 at 00:41
  • My Reflection output is identical to what is happens with CodeDom from the Designer but I would just like to utilize the code generation from the Designer to eliminate the need for my Reflection code. – Steve Nov 22 '12 at 00:50

0 Answers0