public bool TryGetOptionalEnumValue <T>(ParamName paramName, out T value) where T : struct
        {
            if (ValueSet.TryGetValue(paramName.ToString(), out object rawValue))
            {
                return(TryConvertEnumValue(paramName, rawValue, out value));
            }

            value = default(T);
            return(false);
        }
        private bool GetRequiredValue(ParamName paramName, out object value)
        {
            if (ValueSet.TryGetValue(paramName.ToString(), out value))
            {
                return(true);
            }

            LastError = ServiceCommandResponse.CreateError(
                CommandName,
                ServiceErrorInfo.MissingRequiredMessageValue(paramName));
            return(false);
        }
Пример #3
0
        public bool GetComParameterValue(ParamName name, out int result)
        {
            ComParameter param = GetComParameterByName(name.ToString());

            if (param is null)
            {
                result = 0;
                return(false);
            }
            else
            {
                result = param.ComParamValue;
                return(true);
            }
        }
Пример #4
0
 public override string ToString()
 {
     return(ParamName.ToString());
 }
Пример #5
0
 public int GetComParameterValue(ParamName name)
 {
     return(GetComParameterByName(name.ToString()).ComParamValue);
 }