Beispiel #1
0
 public DoubleDepotDictionaryField(string[] includedKeys = null, ConstraintDescriptorFlags[] cdFlags = null, double[] cdValues = null)
 {
     if (includedKeys != null)
     {
         this.IncludedKeys = includedKeys;
     }
     if (cdFlags != null && cdValues != null)
     {
         if (cdFlags.Length != cdValues.Length)
         {
             throw new Exception("ConstraintDescriptor flags and values arrays must be of same length");
         }
         Constraints = new DoubleConstraintDescriptor(cdFlags, cdValues);
         if (includedKeys != null)
         {
             priority = 1;
         }
         else
         {
             priority = -1;
         }
     }
     else
     {
         Constraints = new DoubleConstraintDescriptor(new ConstraintDescriptorFlags[0], new double[0]);
         if (includedKeys != null)
         {
             priority = 0;
         }
         else
         {
             priority = -1;
         }
     }
 }
Beispiel #2
0
 public DoubleBackedField(string fieldName, FieldDescriptorFlags flags = FieldDescriptorFlags.NONE, double defaultValue = 0,
                          ConstraintDescriptorFlags[] cdFlags          = null, double[] cdValues = null)
 {
     FieldName    = fieldName;
     Flags        = flags;
     DefaultValue = defaultValue;
     if (cdFlags != null && cdValues != null)
     {
         if (cdFlags.Length != cdValues.Length)
         {
             throw new Exception("ConstraintDescriptor flags and values arrays must be of same length");
         }
         Constraints = new DoubleConstraintDescriptor(cdFlags, cdValues);
     }
     else
     {
         Constraints = new DoubleConstraintDescriptor(new ConstraintDescriptorFlags[0], new double[0]);
     }
 }