Posts Tagged Windows Forms

Dynamic Code/Class Generation (Update)

Overview
Back not to long ago, I released a post dealing with the dynamic generation of classes at run-time. Since then I have applied the concepts shown in that post in my real-world projects. As expected of any new code, I have found several bugs and inconveniences with the original code from that post. This time around I have an updated CodeGenerationHelper class, a DynamicFactory class, and an actual example of how to use the generated objects. The download-able version of the sample can be obtained through this link: http://thrash505.webs.com/DynamicCodeGeneration.zip

Read the rest of this entry »

, , , , , , ,

15 Comments

C# CodeGenerationHelper – Dynamic Classes – Create Class From Hashtable at Run-time

UPDATE
This post has been depreciated, for an updated version please visit: https://thrash505.wordpress.com/2010/03/18/dynamic-codeclass-generation-update/

Overview
Back a few months ago I had a class that needed (or so I thought) to be generated at run-time. The need arose from WPF controls only working with Properties, not fields, and more specifically ones that implemented INotifyPropertyChanged. (or dependency properties, but I typically save those for custom controls) After some research I created a simple straightforward helper class, CodeGenerationHelper, that would create a dynamic class at run-time from a hashtable. From a hashtable because my solution was working with data received through XML-RPC in the from of an extended hastable implementation. (XmlRpcStruct)

Read the rest of this entry »

, , , , ,

6 Comments