Demonstration of Dynamic Type Creation and Resolution

This is a modified sample from the .NET Framework SDK.  Basically demonstrates how to programmatically drive the ILGenerator to emit code resulting in a method definition.  Note that it is wrapped in a programmatically created assembly that exists only in memory.  In the Main of this Application, the dynamic assembly is unwrapped and reflection isContinue reading “Demonstration of Dynamic Type Creation and Resolution”

General Purpose Data Synchronization Between Objects – The Easy Way

  When moving messages between systems, I’ve often found myself confronted with the need to copy values from one object representation to another.  The objects may or may not have any Properties whose names and Types match, so the solution to this problem must be tolerant of incongruent data shapes.  This can always be achievedContinue reading “General Purpose Data Synchronization Between Objects – The Easy Way”

Use the ASP.NET ViewState with WebUserControls’ public Properties

  This technique works with WebForms, but becomes much more useful when you site WebUserControls on a WebForm and need to set/get values between the parent Form and a child UserControl.   Put something like this in your WebUserCotrol1.   public int Total {         get { return ViewState["intTotal"] != null ? Int32.Parse(ViewState["intTotal"].ToString()) : 0;Continue reading “Use the ASP.NET ViewState with WebUserControls’ public Properties”