public static PairwiseValueCollection CreateFromObjects(params object[] values) { PairwiseValueCollection coll = new PairwiseValueCollection(); foreach (object o in values) { coll.Add(new PairwiseValue(o)); } return(coll); }
public static PairwiseValueCollection CreateFromEnumType(Type t) { if (!t.IsEnum) { throw new ArgumentException(t.FullName + " isn't an enum!"); } PairwiseValueCollection coll = new PairwiseValueCollection(); foreach (Enum e in Enum.GetValues(t)) { coll.Add(new PairwiseValue(e)); } return(coll); }
// Rule support public PairwiseValue AddValue(PairwiseValue value) { if (!setFirstType) { firstType = value.PairwiseValueType; setFirstType = true; } if (value.PairwiseValueType != firstType) { throw new PairwiseException(string.Format("Type mismatch: {0} != {1}", this.firstType, value.ValueType, firstType)); } valueCollection.Add(value); return(value); }