Example #1
0
        public TyonAddress RequestAddress(TyonDehydrater dehydrater)
        {
            if (GetTyonAddress() == null)
            {
                SetTyonAddress(dehydrater.GetNewInternalAddress());
            }

            return(GetTyonAddress());
        }
Example #2
0
        public TyonObject(object obj, TyonDehydrater dehydrater) : this()
        {
            dehydrater.RegisterInternalObject(obj, this);

            SetTyonType(TyonType.CreateTyonType(obj.GetType()));
            SetTyonVariables(
                dehydrater.GetDesignatedVariables(obj.GetType())
                .Convert(v => new TyonVariable(v.CreateStrongInstance(obj), dehydrater))
                );
        }
Example #3
0
        public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
        {
            if (value.IsToStringOverridden())
            {
                if (field_type.CanHaveChildTypes())
                {
                    return(new TyonValue_Surrogate(value, dehydrater));
                }

                return(new TyonValue_String(value, dehydrater));
            }

            return(new TyonValue_Object(value, dehydrater));
        }
Example #4
0
 public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
 {
     return(new TyonValue_Array(field_type.GetIEnumerableType(), value, dehydrater));
 }
Example #5
0
 public TyonValue_Boolean(object value, TyonDehydrater dehydrater) : this()
 {
     SetBool(value.ConvertEX <bool>());
 }
Example #6
0
 public TyonValueList(Type element_type, IEnumerable <object> values, TyonDehydrater dehydrater) : this()
 {
     SetTyonValues(values.Convert(v => dehydrater.CreateTyonValue(element_type, v)));
 }
Example #7
0
 public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
 {
     return(new TyonValue_ExternalAddress(dehydrater.RegisterExternalObject(value), dehydrater));
 }
Example #8
0
 public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
 {
     return(new TyonValue_Type(value.ConvertEX <Type>(), dehydrater));
 }
Example #9
0
 public TyonValue_Decimal(object value, TyonDehydrater dehydrater) : this()
 {
     SetDecimal(value.ConvertEX <decimal>());
 }
Example #10
0
 public TyonValue_Type(Type type, TyonDehydrater dehydrater)
 {
     SetTyonType(TyonType.CreateTyonType(type));
 }
Example #11
0
 public TyonValue_Surrogate(object value, TyonDehydrater dehydrater) : this()
 {
     SetTyonSurrogate(new TyonSurrogate(value, dehydrater));
 }
Example #12
0
 public TyonValue_Float(object value, TyonDehydrater dehydrater) : this()
 {
     SetFloat(value.ConvertEX <float>());
 }
Example #13
0
 public TyonValue_ExternalAddress(TyonAddress a, TyonDehydrater dehydrater) : this()
 {
     SetTyonAddress(a);
 }
Example #14
0
 public TyonValue_String(object value, TyonDehydrater dehydrater) : this()
 {
     SetString(value.ToStringEX());
 }
Example #15
0
 public TyonArray(Type element_type, object value, TyonDehydrater dehydrater) : this()
 {
     SetTyonType(TyonType.CreateTyonType(element_type));
     SetTyonValueList(new TyonValueList(element_type, value.ToEnumerable <object>(), dehydrater));
 }
Example #16
0
 public TyonVariable(VariableInstance variable, TyonDehydrater dehydrater) : this()
 {
     SetId(variable.GetVariable().GetVariableName());
     SetTyonValue(dehydrater.CreateTyonValue(variable.GetVariableType(), variable.GetContents()));
 }
Example #17
0
 public abstract TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater);
Example #18
0
 public TyonSurrogate(object value, TyonDehydrater dehydrater) : this()
 {
     SetTyonType(TyonType.CreateTyonType(value.GetTypeEX()));
     SetTyonValue(new TyonValue_String(value, dehydrater));
 }
Example #19
0
 public TyonValue_Long(object value, TyonDehydrater dehydrater) : this()
 {
     SetLong(value.ConvertEX <long>());
 }
Example #20
0
 public TyonValue_Array(Type element_type, object value, TyonDehydrater dehydrater) : this()
 {
     SetTyonArray(new TyonArray(element_type, value, dehydrater));
 }
Example #21
0
        public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
        {
            value = deconstruction_invokers.Fetch(value.GetType())(value);

            return(dehydrater.CreateTyonValue(value.GetTypeEX(), value));
        }
Example #22
0
        public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
        {
            value = Substitute(value);

            return(dehydrater.CreateTyonValue(value.GetTypeEX(), value));
        }
Example #23
0
 public TyonValue_InternalAddress(TyonAddress address, TyonDehydrater dehydrater) : this()
 {
     SetTyonAddress(address);
 }
Example #24
0
 public override TyonValue Dehydrate(Type field_type, object value, TyonDehydrater dehydrater)
 {
     return(new TyonValue_Decimal(value, dehydrater));
 }
Example #25
0
 public TyonValue_Double(object value, TyonDehydrater dehydrater) : this()
 {
     SetDouble(value.ConvertEX <double>());
 }
Example #26
0
 public TyonValue_Int(object value, TyonDehydrater dehydrater) : this()
 {
     SetInt(value.ConvertEX <int>());
 }
Example #27
0
 public TyonValue_Object(object value, TyonDehydrater dehydrater) : this()
 {
     SetTyonObject(new TyonObject(value, dehydrater));
 }