예제 #1
0
        public static PairwiseValueCollection CreateFromObjects(params object[] values)
        {
            PairwiseValueCollection coll = new PairwiseValueCollection();

            foreach (object o in values)
            {
                coll.Add(new PairwiseValue(o));
            }

            return(coll);
        }
예제 #2
0
        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);
        }
예제 #3
0
        // 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);
        }