Пример #1
0
 public XmlSaver(TypeFinder typeFinder)
 {
     this.typeFinder = typeFinder;
     loadControl     = new LoadControl(typeFinder);
     saveableValue   = new XmlSaveable(this);
     valueReaders.Add(saveableValue.ElementName, saveableValue);
     enumValue = new XmlEnum(this);
     valueReaders.Add(enumValue.ElementName, enumValue);
     valueWriters = new ValueWriterCollection(saveableValue, enumValue);
     addXmlValue <bool>(new XmlBool(this));
     addXmlValue <byte>(new XmlByte(this));
     addXmlValue <char>(new XmlChar(this));
     addXmlValue <decimal>(new XmlDecimal(this));
     addXmlValue <double>(new XmlDouble(this));
     addXmlValue <float>(new XmlFloat(this));
     addXmlValue <int>(new XmlInt(this));
     addXmlValue <long>(new XmlLong(this));
     addXmlValue <Quaternion>(new XmlQuaternion(this));
     addXmlValue <Ray3>(new XmlRay3(this));
     addXmlValue <sbyte>(new XmlSByte(this));
     addXmlValue <short>(new XmlShort(this));
     addXmlValue <String>(new XmlString(this));
     addXmlValue <uint>(new XmlUInt(this));
     addXmlValue <ulong>(new XmlULong(this));
     addXmlValue <ushort>(new XmlUShort(this));
     addXmlValue <Vector3>(new XmlVector3(this));
     addXmlValue <Color>(new XmlColor(this));
     addXmlValue <byte[]>(new XmlBlob(this));
     addXmlValue <Guid>(new XmlGuid(this));
     saveControl = new SaveControl(this, valueWriters, this);
 }
Пример #2
0
 public JsonSaver(TypeFinder typeFinder)
 {
     this.typeFinder = typeFinder;
     loadControl     = new LoadControl(typeFinder);
     saveableValue   = new JsonSaveable(this);
     valueReaders.Add(saveableValue.ElementName, saveableValue);
     enumValue = new JsonEnum(this);
     valueReaders.Add(enumValue.ElementName, enumValue);
     valueWriters = new ValueWriterCollection(saveableValue, enumValue);
     addParser <bool>(new JsonBool(this));
     addParser <byte>(new JsonByte(this));
     addParser <char>(new JsonChar(this));
     addParser <decimal>(new JsonDecimal(this));
     addParser <double>(new JsonDouble(this));
     addParser <float>(new JsonFloat(this));
     addParser <int>(new JsonInt(this));
     addParser <long>(new JsonLong(this));
     addParser <Quaternion>(new JsonQuaternion(this));
     addParser <Ray3>(new JsonRay3(this));
     addParser <sbyte>(new JsonSByte(this));
     addParser <short>(new JsonShort(this));
     addParser <String>(new JsonString(this));
     addParser <uint>(new JsonUInt(this));
     addParser <ulong>(new JsonULong(this));
     addParser <ushort>(new JsonUShort(this));
     addParser <Vector3>(new JsonVector3(this));
     addParser <Color>(new JsonColor(this));
     addParser <byte[]>(new JsonBlob(this));
     addParser <Guid>(new JsonGuid(this));
     saveControl = new SaveControl(this, valueWriters, this);
 }