/// <summary> /// /// </summary> /// <param name="realParameter"></param> /// <param name="session"></param> public ParameterModel(ModuleParameter realParameter, ModelSystemEditingSession session) { IsDirty = false; RealParameter = realParameter; _Session = session; _Value = _Value = RealParameter.Value != null?RealParameter.Value.ToString() : string.Empty; }
public IModuleParameter Clone() { ModuleParameter copy = new ModuleParameter(); copy.Name = this.Name; if (this.Value is ICloneable) { copy.Value = (this.Value as ICloneable).Clone(); } else { string error = null; // we can't have them referencing the same object or changing one will change the original if (Value != null) { copy.Value = ArbitraryParameterParser.ArbitraryParameterParse(this.Type, this.Value.ToString(), ref error); } else { copy.Value = null; } } copy.Description = this.Description; copy.VariableName = this.VariableName; copy.OnField = this.OnField; copy.SystemParameter = this.SystemParameter; copy.QuickParameter = this.QuickParameter; copy.BelongsTo = this.BelongsTo; copy.Type = this.Type; return(copy); }
public ParameterModel(ModuleParameter realParameter, ModelSystemEditingSession session) { IsDirty = false; RealParameter = realParameter; Session = session; Name = RealParameter.Name; _Value = _Value = RealParameter.Value != null ? RealParameter.Value.ToString() : string.Empty; }
/// <summary> /// /// </summary> /// <param name="realParameter"></param> /// <param name="session"></param> /// <param name="belongsTo"></param> public ParameterModel(ModuleParameter realParameter, ModelSystemEditingSession session, ModelSystemStructureModel belongsTo) { IsDirty = false; RealParameter = realParameter; _Session = session; _Value = _Value = RealParameter.Value != null?RealParameter.Value.ToString() : string.Empty; _belongsTo = belongsTo; }
public IModuleParameter Clone() { ModuleParameter copy = new ModuleParameter(); copy.Name = this.Name; if ( this.Value is ICloneable ) { copy.Value = ( this.Value as ICloneable ).Clone(); } else { string error = null; // we can't have them referencing the same object or changing one will change the original copy.Value = ArbitraryParameterParser.ArbitraryParameterParse( this.Type, this.Value.ToString(), ref error ); } copy.Description = this.Description; copy.VariableName = this.VariableName; copy.OnField = this.OnField; copy.SystemParameter = this.SystemParameter; copy.QuickParameter = this.QuickParameter; copy.BelongsTo = this.BelongsTo; copy.Type = this.Type; return copy; }