Beispiel #1
0
        private void Validate(int index, DataColumnMapping value)
        {
            if (value == null)
            {
                throw ADP.ColumnsAddNullAttempt("value");
            }
            if (value.Parent != null)
            {
                if (this != value.Parent)
                {
                    throw ADP.ColumnsIsNotParent(this);
                }
                if (index != this.IndexOf(value))
                {
                    throw ADP.ColumnsIsParent(this);
                }
            }
            string sourceColumn = value.SourceColumn;

            if (ADP.IsEmpty(sourceColumn))
            {
                index = 1;
                do
                {
                    sourceColumn = "SourceColumn" + index.ToString(CultureInfo.InvariantCulture);
                    index++;
                }while (-1 != this.IndexOf(sourceColumn));
                value.SourceColumn = sourceColumn;
            }
            else
            {
                this.ValidateSourceColumn(index, sourceColumn);
            }
        }
Beispiel #2
0
        private void Validate(int index, DataColumnMapping value)
        {
            if (null == value)
            {
                throw ADP.ColumnsAddNullAttempt(nameof(value));
            }
            if (null != value.Parent)
            {
                if (this != value.Parent)
                {
                    throw ADP.ColumnsIsNotParent(this);
                }
                else if (index != IndexOf(value))
                {
                    throw ADP.ColumnsIsParent(this);
                }
            }

            string name = value.SourceColumn;

            if (string.IsNullOrEmpty(name))
            {
                index = 1;
                do
                {
                    name = ADP.SourceColumn + index.ToString(System.Globalization.CultureInfo.InvariantCulture);
                    index++;
                } while (-1 != IndexOf(name));
                value.SourceColumn = name;
            }
            else
            {
                ValidateSourceColumn(index, name);
            }
        }
Beispiel #3
0
        private void Validate(int index, DataColumnMapping value)
        {
            if (null == value)
            {
                throw ADP.ColumnsAddNullAttempt("value");
            }
            if (null != value.Parent)
            {
                if (this != value.Parent)
                {
                    throw ADP.ColumnsIsNotParent(value.SourceColumn);
                }
                else if (index != IndexOf(value))
                {
                    throw ADP.ColumnsIsParent(value.SourceColumn);
                }
            }

            String name = value.SourceColumn;

            if (ADP.IsEmpty(name))
            {
                index = 1;
                do
                {
                    name = ADP.SourceColumn + index.ToString();
                    index++;
                } while (-1 != IndexOf(name));
                value.SourceColumn = name;
            }
            else
            {
                ValidateSourceColumn(index, name);
            }
        }
Beispiel #4
0
 public void Insert(int index, DataColumnMapping value)
 {
     if (null == value)
     {
         throw ADP.ColumnsAddNullAttempt(nameof(value));
     }
     Validate(-1, value);
     value.Parent = this;
     ArrayList().Insert(index, value);
 }
Beispiel #5
0
 public void Insert(int index, DataColumnMapping value)
 {
     if (value == null)
     {
         throw ADP.ColumnsAddNullAttempt("value");
     }
     this.Validate(-1, value);
     value.Parent = this;
     this.ArrayList().Insert(index, value);
 }
Beispiel #6
0
 private void ValidateType(object value)
 {
     if (null == value)
     {
         throw ADP.ColumnsAddNullAttempt(nameof(value));
     }
     else if (!ItemType.IsInstanceOfType(value))
     {
         throw ADP.NotADataColumnMapping(value);
     }
 }
Beispiel #7
0
 private void ValidateType(object value)
 {
     if (value == null)
     {
         throw ADP.ColumnsAddNullAttempt("value");
     }
     if (!this.ItemType.IsInstanceOfType(value))
     {
         throw ADP.NotADataColumnMapping(value);
     }
 }
Beispiel #8
0
        public void Remove(DataColumnMapping value)
        {
            if (value == null)
            {
                throw ADP.ColumnsAddNullAttempt("value");
            }
            int index = this.IndexOf(value);

            if (-1 == index)
            {
                throw ADP.CollectionRemoveInvalidObject(this.ItemType, this);
            }
            this.RemoveIndex(index);
        }
Beispiel #9
0
        public void Remove(DataColumnMapping value)
        {
            if (null == value)
            {
                throw ADP.ColumnsAddNullAttempt(nameof(value));
            }
            int index = IndexOf(value);

            if (-1 != index)
            {
                RemoveIndex(index);
            }
            else
            {
                throw ADP.CollectionRemoveInvalidObject(ItemType, this);
            }
        }