예제 #1
0
        /// <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));
            }
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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));
 }
예제 #4
0
        /// <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);
        }
예제 #5
0
 /// <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;
 }