コード例 #1
0
ファイル: FrameParam.cs プロジェクト: bzercher/UIMF-Library
        /// <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
ファイル: FrameParam.cs プロジェクト: bzercher/UIMF-Library
 /// <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;
 }