System.Data.DataColumnCollection.BaseAdd C# (CSharp) Метод

BaseAdd() приватный Метод

Does verification on the column and it's name, and points the column at the dataSet that owns this collection. An ArgumentNullException is thrown if this column is null. An ArgumentException is thrown if this column already belongs to this collection, belongs to another collection. A DuplicateNameException is thrown if this collection already has a column with the same name (case insensitive).
private BaseAdd ( DataColumn column ) : void
column DataColumn
Результат void
        private void BaseAdd(DataColumn column)
        {
            if (column == null)
            {
                throw ExceptionBuilder.ArgumentNull(nameof(column));
            }
            if (column._table == _table)
            {
                throw ExceptionBuilder.CannotAddColumn1(column.ColumnName);
            }
            if (column._table != null)
            {
                throw ExceptionBuilder.CannotAddColumn2(column.ColumnName);
            }

            if (column.ColumnName.Length == 0)
            {
                column.ColumnName = AssignName();
            }

            RegisterColumnName(column.ColumnName, column);
            try
            {
                column.SetTable(_table);
                if (!_table.fInitInProgress && column.Computed)
                {
                    if (column.DataExpression.DependsOn(column))
                    {
                        throw ExceptionBuilder.ExpressionCircular();
                    }
                }

                if (0 < _table.RecordCapacity)
                {
                    // adding a column to table with existing rows
                    column.SetCapacity(_table.RecordCapacity);
                }

                // fill column with default value.
                for (int record = 0; record < _table.RecordCapacity; record++)
                {
                    column.InitializeRecord(record);
                }

                if (_table.DataSet != null)
                {
                    column.OnSetDataSet();
                }
            }
            catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e))
            {
                UnregisterName(column.ColumnName);
                throw;
            }
        }