public object InstanceSystemObject(TyonHydrater hydrater) { return(hydrater.HydrateValue( GetTyonType().GetSystemType(hydrater), GetTyonValue() ) ?? GetTyonType().InstanceSystemObject(hydrater)); }
public void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { Type log_type = GetLogSystemType(hydrater); Variable_IndexedLog log = Variable_IndexedLog.New(log_type); if (variable.GetContents() != null) { int index = 0; foreach (object old_element in variable.GetContents().Convert <IEnumerable>()) { log.CreateStrongInstance(index++).SetContents(old_element); } } GetTyonValueList().IfNotNull(l => l.PushToLogVariable(log, hydrater)); hydrater.DeferProcess(delegate() { List <object> values = log.GetValues() .Truncate(GetNumberTyonValues()) .ToList(); Type final_type = IsExplicitlyTyped().ConvertBool( () => log_type, () => values.Convert(v => v.GetTypeEX()).GetCommonAncestor() ); variable.SetContents(values.ToArrayOfType(final_type)); }); }
public Type GetLogSystemType(TyonHydrater hydrater) { if (IsExplicitlyTyped()) { return(GetTyonType().GetSystemType(hydrater)); } return(typeof(object)); }
public void PushToSystemObject(object obj, TyonHydrater hydrater) { Variable variable; if (hydrater.TryGetDesignatedVariable(obj.GetType(), GetId(), out variable)) { GetTyonValue().PushToVariable(variable.CreateStrongInstance(obj), hydrater); } else { hydrater.LogMissingField(obj.GetType(), GetId()); } }
public void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { if (AllowsHotloading() && variable.GetVariableType().IsTypicalReferenceType()) { object current_value = variable.GetContents(); if (current_value != null) { if (GetSystemType(hydrater) == current_value.GetType()) { PushToSystemObject(current_value, hydrater); return; } } } variable.SetContents(InstanceSystemObject(hydrater)); }
public object InstanceSystemObject(TyonHydrater hydrater) { object system_object = null; if (GetTyonValueList() != null) { Variable_IndexedLog log = Variable_IndexedLog.New(typeof(object)); GetTyonValueList().PushToLogVariable(log, hydrater); system_object = GetTyonType().InstanceSystemObject(hydrater, log.GetValues().ToArray()); } else { system_object = GetTyonType().InstanceSystemObject(hydrater); } return(system_object.ChainIfNotNull(o => PushToSystemObject(o, hydrater))); }
public abstract void PushToVariable(VariableInstance variable, TyonHydrater hydrater);
public override object InstanceSystemObject(TyonHydrater hydrater, object[] arguments) { return(null); }
public void PushToLogVariable(Variable variable, TyonHydrater hydrater) { GetTyonValues().ProcessWithIndex((i, v) => v.PushToVariable(variable.CreateStrongInstance(i), hydrater)); }
public override object InstanceSystemObject(TyonHydrater hydrater, object[] arguments) { return(GetSystemType(hydrater).IfNotNull(t => t.CreateInstance(arguments))); }
public object InstanceSystemObject(TyonHydrater hydrater) { return(InstanceSystemObject(hydrater, Empty.Array <object>())); }
public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { variable.SetContents(GetTyonType().GetSystemType(hydrater)); }
public void PushToSystemObject(object obj, TyonHydrater hydrater) { hydrater.RegisterInternalAddress(obj, GetTyonAddress()); GetTyonVariables().Process(v => v.PushToSystemObject(obj, hydrater)); }
public Type GetSystemType(TyonHydrater hydrater) { return(GetTyonType().GetSystemType(hydrater)); }
public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { variable.SetContents(hydrater.ResolveExternalAddress(GetTyonAddress())); }
public void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { variable.SetContents(InstanceSystemObject(hydrater)); }
public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { GetTyonArray().PushToVariable(variable, hydrater); }
public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { hydrater.DeferProcess(delegate() { variable.SetContents(hydrater.ResolveInternalAddress(GetTyonAddress())); }); }
public override void PushToVariable(VariableInstance variable, TyonHydrater hydrater) { variable.SetContents(GetInt()); }
public abstract object InstanceSystemObject(TyonHydrater hydrater, object[] arguments);