Esempio n. 1
0
        protected void AddValue(T value)
        {
            if (PossibleValues.Any() && !value.EqualToAny(PossibleValues))
            {
                throw new ArgumentOutOfRangeException(string.Format("'{0}' is not a possible value", value));
            }

            _value.Add(value);
            IsSpecified = true;
        }
Esempio n. 2
0
        internal void SetValue(T value)
        {
            if (IsSpecified)
            {
                throw new InvalidOperationException("Multiple set for a non-list parameter");
            }

            if (PossibleValues.Any() && !value.EqualToAny(PossibleValues))
            {
                throw new InvalidOperationException(string.Format("'{0}' is not a possible value", value));
            }

            Value       = value;
            IsSpecified = true;
        }