internal void RegisterName(string name) { int count = this.List.Count; for (int i = 0; i < count; i++) { if (base.NamesEqual(name, ((Constraint)this.List[i]).ConstraintName, true, this.table.Locale) != 0) { throw ExceptionBuilder.DuplicateConstraintName(((Constraint)this.List[i]).ConstraintName); } } if (base.NamesEqual(name, this.MakeName(this.defaultNameIndex), true, this.table.Locale) != 0) { this.defaultNameIndex++; } }
/// <summary> /// Registers this name as being used in the collection. Will throw an ArgumentException /// if the name is already being used. Called by Add, All property, and Constraint.ConstraintName property. /// if the name is equivalent to the next default name to hand out, we increment our defaultNameIndex. /// </summary> internal void RegisterName(string name) { Debug.Assert(name != null); int constraintCount = List.Count; for (int i = 0; i < constraintCount; i++) { if (NamesEqual(name, ((Constraint)List[i]).ConstraintName, true, _table.Locale) != 0) { throw ExceptionBuilder.DuplicateConstraintName(((Constraint)List[i]).ConstraintName); } } if (NamesEqual(name, MakeName(_defaultNameIndex), true, _table.Locale) != 0) { _defaultNameIndex++; } }