Drawing3d documented Class Library

NicerXMLFormatter Members

NicerXMLFormatter overview

Public Static (Shared) Fields

Aliases A static list, which contains the aliases NicerXMLFormatter.Alias

Public Instance Constructors

NicerXMLFormatter Constructor Empty contructor

Public Instance Fields

ReferenceSupport Sets or gets the kind of handlicg for references

Public Instance Properties

Binder Gets or sets the type binder.
Context Gets or sets the StreamingContext.
StringConverter With the StringConverter you can convert objects to a string. If you do this, the object has the behavior of a primitiv object. The avantage is also, that the XML is better to read. For example: if you have a object Point with the fields X and Y ( of type int) you get the XML source like
 <field type:Point > <X>3</X> <Y>5</Y> </field> 
You can make your own Stringconverter like this:
 public class MyStringConverter:CustomStringConverter { public override bool CanConvert(Type Type) { if (base.Convert(Type)) return true; if (Type == typeof(Point)) return true; if (Type == typeof(Color)) return true; return false; } public override string ConvertToString(object Value, Type Type) { if (base.Convert(Type)) return base.ConvertToString(value,Type); if (Type == typeof(Point)) return (Point.X.ToString)+","+(Point.y.ToString); if (Type == typeof(Color)) return new ColorConverter().ConvertToString(Value); return ""; } public override object ConvertFromString(String Value, Type Type) { if (base.CanConvert(Type)) return base.ConvertFromString(Value,Type); if (Type == typeof(Point)) { string[] S = Value.Split(','); return new Point(Convert.ToInt32(S[0]), Convert.ToInt32(S[1])); } if (Type == typeof(Color)) return new ColorConverter().ConvertFromString(Value); return false; } } 
You have to set this in the StringConverter property: StringConverter = new MyStringConverter;
SurrogateSelector Gets or sets the SurrogateSelector.

Public Instance Methods

Deserialize Deserializes an object from the passed stream.
Equals (inherited from Object) 
GetHashCode (inherited from Object) 
GetType (inherited from Object) 
Serialize Serializes the passed object to the passed stream.
ToString (inherited from Object) 

Public Instance Events

CheckDefaultEquality The event is called from CheckDefaultEquals For example: Define in the object
 public class MyComponent:object { private Color _Color=Color.Brown; [DefaultValue("Brown")] public Color MyColor { get { return _Color; } set { _Color = value; } } } 
In the event
 if ((EqualsTo.GetType() == typeof(Color)) && (DefValue is String)) { Color C = (Color)EqualsTo; return (C.Name.ToUpper() == ((string)DefValue).ToUpper()); } 

Protected Instance Methods

Finalize (inherited from Object) 
MemberwiseClone (inherited from Object) 

See Also

NicerXMLFormatter Class | Drawing3d Namespace