View Complete Post
Let's say that I've got one custom webcontrol called MyControl.
[ParseChildren(true)]public partial class MyControl: WebControl {[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [PersistenceMode(PersistenceMode.InnerProperty)] public IComplex Complex { get; set; }}
The control is a very simple control but it holds an instance of a complex type that is accessable through a property. The property has the propertytype IComplex
public interface IComplex { string Name { get; set; } List<IComplex> Children {get;}}
Let's say that I am able to pick one of several different types of object that derives from IComplex in design-time and assign it to the controls property "Complex" property.
Naturally I would like to persist this information to the HTML-View in a user-friendly way.
Because we don't know what type the user has picked there is no way to instansiate the type if we don't persist the name of that type. The Type could also contain more properties than the Interface the controls property is refering.
<cc1:MyControl id="MyControl1" runat="server"> <Complex> <!-
We use the new Asynchronous Agents Library in Visual C++ 2010 to solve the classic Dining Philosophers concurrency problem.
Rick Molloy
MSDN Magazine June 2009
Custom field types provide a powerful way to define a reusable SharePoint column definitions.
Ted Pattison
MSDN Magazine May 2009
See how to build a document-level Visual Studio Tools for Office customization and integrate it with a content type in SharePoint.
Steve Fox
MSDN Magazine May 2008
In artificial intelligence, an agent is a logical entity that has some level of autonomy within its environment or host. A mobile agent has the added capability that it can move between hosts. In this article Matt Neely brings mobile agents from the halls of academia to a dev shop near you.
Matt Neely
MSDN Magazine February 2006
A funny thing happened to templates on their way to the common language runtime (CLR)-they lost their {type} identity. This is analogous to what happens with macros under native programs. Just as the C/C++ compilers have no awareness of macro preprocessor expansions, the CLR has no awareness of template instantiations.
Stanley B. Lippman
MSDN Magazine December 2005
Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.
Bob DeRemer
MSDN Magazine March 2004
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend