public StringDepotDictionaryField(string[] includedKeys = null, ConstraintDescriptorFlags[] cdFlags = null, string[] 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 StringConstraintDescriptor(cdFlags, cdValues); if (includedKeys != null) { priority = 1; } else { priority = -1; } } else { Constraints = new StringConstraintDescriptor(new ConstraintDescriptorFlags[0], new string[0]); if (includedKeys != null) { priority = 0; } else { priority = -1; } } }
public StringBackedField(string fieldName, FieldDescriptorFlags flags = FieldDescriptorFlags.NONE, string defaultValue = null, ConstraintDescriptorFlags[] cdFlags = null, string[] 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 StringConstraintDescriptor(cdFlags, cdValues); } else { Constraints = new StringConstraintDescriptor(new ConstraintDescriptorFlags[0], new string[0]); } }