System.Data.Common.DataColumnMappingCollection.IndexOf(object)

Here are the examples of the csharp api class System.Data.Common.DataColumnMappingCollection.IndexOf(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

1. Example

View license
public bool Contains(object value) {
            return(-1 != IndexOf(value));
        }

2. Example

View license
public void Remove (DataColumnMapping value) {
            if (null == value) {
                throw ADP.ColumnsAddNullAttempt ("value");
            }
            int index = IndexOf (value);

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

3. Example

View license
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(this);
                }
                else if (index != IndexOf(value)) {
                    throw ADP.ColumnsIsParent(this);
                }
            }

            String name = value.SourceColumn;
            if (ADP.IsEmpty(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);
            }
        }