Exemple #1
0
        public TyonValue CreateTyonValue(Type field_type, object value)
        {
            if (value != null)
            {
                Type value_type = value.GetType();

                TyonAddress address;
                if (context.TryResolveExternalObject(value, out address))
                {
                    return(new TyonValue_ExternalAddress(address, this));
                }

                TyonAddressable addressable;
                if (object_to_tyon_addressable.TryGetValue(value, out addressable))
                {
                    return(new TyonValue_InternalAddress(addressable.RequestAddress(this), this));
                }

                return(context.GetSettings().GetTypeHandler(value_type).Dehydrate(field_type, value, this));
            }

            return(new TyonValue_Null());
        }
Exemple #2
0
 public bool TryGetDesignatedVariable(Type type, string name, out Variable variable)
 {
     return(context.GetSettings().TryGetDesignatedVariable(type, name, out variable));
 }