I know that a XmlSerializer throws an exception if the type passed does not match the type Since then the serializer was created My question is: Is it possible to serial the base type without knowing the derivative type? Consider the following scenario: The following classes are in a top-level domain and there is no dependency : Public Class Serializer {Private Static String Serialize (base basedata) {var serializer = New XML serializer (typefile); Var sb = new stringbilder (); (Var author = XmlWriter.Create (sb)) using {serializer.Serialize (author, bassadata); } Return sb.ToString (); } Private static string Deserialize (...) {...}} Public class base {public string name {get; Set; }} The following derivative classes have additional dependencies on things like UI components, structure, etc. (and more on this later): [Export (Typ (IMyComponent)] Public category was created: Base, IMyComponent, INotifyPropertyChanged {public new string name {get {return base.Name; ...
Comments
Post a Comment