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; }
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; }