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

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

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