internal void RegisterName(string name)
        {
            Bid.Trace("<ds.DataRelationCollection.RegisterName|INFO> %d#, name='%ls'\n", this.ObjectID, name);
            CultureInfo locale = this.GetDataSet().Locale;
            int         count  = this.Count;

            for (int i = 0; i < count; i++)
            {
                if (base.NamesEqual(name, this[i].RelationName, true, locale) != 0)
                {
                    throw ExceptionBuilder.DuplicateRelation(this[i].RelationName);
                }
            }
            if (base.NamesEqual(name, this.MakeName(this.defaultNameIndex), true, locale) != 0)
            {
                this.defaultNameIndex++;
            }
        }
Beispiel #2
0
        /// <include file='doc\DataRelationCollection.uex' path='docs/doc[@for="DataRelationCollection.RegisterName"]/*' />
        /// <devdoc>
        /// 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 Relation.RelationName property.
        /// if the name is equivalent to the next default name to hand out, we increment our defaultNameIndex.
        /// </devdoc>
        internal void RegisterName(string name)
        {
            Debug.Assert(name != null);

            CultureInfo locale        = GetDataSet().Locale;
            int         relationCount = Count;

            for (int i = 0; i < relationCount; i++)
            {
                if (NamesEqual(name, this[i].RelationName, true, locale) != 0)
                {
                    throw ExceptionBuilder.DuplicateRelation(this[i].RelationName);
                }
            }
            if (NamesEqual(name, MakeName(defaultNameIndex), true, locale) != 0)
            {
                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 Relation.RelationName property.
        /// if the name is equivalent to the next default name to hand out, we increment our defaultNameIndex.
        /// </summary>
        internal void RegisterName(string name)
        {
            DataCommonEventSource.Log.Trace("<ds.DataRelationCollection.RegisterName|INFO> {0}, name='{1}'", ObjectID, name);
            Debug.Assert(name != null);

            CultureInfo locale        = GetDataSet().Locale;
            int         relationCount = Count;

            for (int i = 0; i < relationCount; i++)
            {
                if (NamesEqual(name, this[i].RelationName, true, locale) != 0)
                {
                    throw ExceptionBuilder.DuplicateRelation(this[i].RelationName);
                }
            }
            if (NamesEqual(name, MakeName(_defaultNameIndex), true, locale) != 0)
            {
                _defaultNameIndex++;
            }
        }