/// <summary> /// Constructor /// </summary> /// <param name="paramDef">Frame parameter definition</param> /// <param name="value">Parameter value</param> public FrameParam(FrameParamDef paramDef, string value) { Definition = paramDef; Value = FrameParamUtilities.ConvertStringToDynamic(paramDef.DataType, value); if (Value == null) { throw new InvalidCastException( string.Format("FrameParam constructor could not convert value of '{0}' for frame parameter {1} to {2}", value, paramDef.ParamType, paramDef.DataType)); } }
/// <summary> /// Add or update a parameter's value /// </summary> /// <param name="paramDef">Frame parameter definition (<see cref="FrameParamDef"/> class)</param> /// <param name="value">Value (dynamic)</param> private FrameParams AddUpdateValueDynamic(FrameParamDef paramDef, dynamic value) { if (Values.TryGetValue(paramDef.ParamType, out var paramEntry)) { paramEntry.Value = value; } else { paramEntry = new FrameParam(paramDef, value); Values.Add(paramDef.ParamType, paramEntry); } return(this); }
/// <summary> /// Add or update a parameter's value /// </summary> /// <param name="paramDef">Frame parameter definition (<see cref="FrameParamDef"/> class)</param> /// <param name="value">Value (dynamic)</param> public FrameParams AddUpdateValue(FrameParamDef paramDef, dynamic value) { return(AddUpdateValueDynamic(paramDef, value)); }
/// <summary> /// Clone this frame parameter definition (deep copy) /// </summary> /// <returns></returns> // ReSharper disable once UnusedMember.Global public FrameParamDef CopyTo() { var paramDefCopy = new FrameParamDef(ParamType, Name, DataType, Description); return(paramDefCopy); }
/// <summary> /// Constructor /// </summary> /// <param name="paramDef">Frame parameter definition</param> /// <param name="value">Parameter value</param> public FrameParam(FrameParamDef paramDef, dynamic value) { Definition = paramDef; Value = value; }