public override object Deserialize(SerializationContext serCtx, object mapData, DataNode data)
 {
     string file = ((DataValue)data).Value;
     if (file == "") return "";
     string basePath = Path.GetDirectoryName (serCtx.BaseFile);
     return Runtime.FileUtilityService.RelativeToAbsolutePath (basePath, file);
 }
 public override object Deserialize(SerializationContext serCtx, object mdata, DataNode data)
 {
     DataCollection items = ((DataItem) data).ItemData;
     object position;
     object collectionInstance = handler.CreateCollection (out position, items.Count);
     Deserialize (serCtx, mdata, items, collectionInstance, position);
     return collectionInstance;
 }
        public override object Deserialize(SerializationContext serCtx, object mapData, DataNode data)
        {
            DataItem item = data as DataItem;
            if (item == null)
                throw new InvalidOperationException ("Invalid value found for type '" + Name + "'");

            DataValue ctype = item ["ctype"] as DataValue;
            if (ctype != null && ctype.Value != Name) {
                DataType stype = FindDerivedType (ctype.Value);
                if (stype != null) return stype.Deserialize (serCtx, mapData, data);
                else throw new InvalidOperationException ("Type not found: " + ctype.Value);
            }

            ConstructorInfo ctor = ValueType.GetConstructor (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, null);
            if (ctor == null) throw new InvalidOperationException ("Default constructor not found for type '" + ValueType + "'");

            object obj = ctor.Invoke (null);
            SetConfigurationItemData (serCtx, obj, item);
            return obj;
        }
 public object Deserialize(Type type, DataNode data)
 {
     return dataContext.LoadConfigurationData (serializationContext, type, data);
 }
 public override object Deserialize(SerializationContext serCtx, object mapData, DataNode data)
 {
     return Convert.ChangeType (((DataValue)data).Value, ValueType);
 }
 public override object Deserialize(SerializationContext serCtx, object mapData, DataNode data)
 {
     return Enum.Parse (ValueType, ((DataValue)data).Value, false);
 }
 internal void Deserialize(SerializationContext serCtx, DataNode data, object valueInstance)
 {
     dataType.Deserialize (serCtx, mapData, data, valueInstance);
 }
 internal object Deserialize(SerializationContext serCtx, DataNode data)
 {
     return dataType.Deserialize (serCtx, mapData, data);
 }
 public object LoadConfigurationData(SerializationContext serCtx, Type type, DataNode data)
 {
     DataType dataType = GetConfigurationDataType (type);
     return dataType.Deserialize (serCtx, null, data);
 }
 public virtual void Deserialize(SerializationContext serCtx, object mapData, DataNode data, object valueInstance)
 {
     throw new InvalidOperationException ("Could not create instance for type '" + ValueType + "'");
 }
 public abstract object Deserialize(SerializationContext serCtx, object mapData, DataNode data);
 public override void Deserialize(SerializationContext serCtx, object mdata, DataNode data, object collectionInstance)
 {
     DataCollection items = ((DataItem) data).ItemData;
     object position;
     handler.ResetCollection (collectionInstance, out position, items.Count);
     Deserialize (serCtx, mdata, items, collectionInstance, position);
 }
 protected virtual void WriteChild(XmlWriter writer, DataNode data)
 {
     DefaultWriter.Write (writer, data);
 }
 public void Write(XmlWriter writer, DataNode data)
 {
     if (data is DataValue)
         writer.WriteElementString (data.Name, ((DataValue)data).Value);
     else if (data is DataItem) {
         writer.WriteStartElement (data.Name);
         WriteAttributes (writer, (DataItem) data);
         WriteChildren (writer, (DataItem) data);
         writer.WriteEndElement ();
     }
 }