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

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

5 Examples 7

1. Example

Project: referencesource
Source File: DataColumnMappingCollection.cs
public bool Contains(string value) {
            return(-1 != IndexOf(value));
        }

2. Example

Project: referencesource
Source File: DataColumnMappingCollection.cs
private int RangeCheck(string sourceColumn) {
            int index = IndexOf(sourceColumn);
            if (index < 0) {
                throw ADP.ColumnsIndexSource(sourceColumn);
            }
            return index;
        }

3. Example

Project: referencesource
Source File: DataColumnMappingCollection.cs
internal void ValidateSourceColumn(int index, string value) {
            int pindex = IndexOf(value);
            if ((-1 != pindex) && (index != pindex)) { // must be non-null and unique
                throw ADP.ColumnsUniqueSourceColumn(value);
            }
        }

4. Example

Project: referencesource
Source File: DataColumnMappingCollection.cs
[ EditorBrowsableAttribute(EditorBrowsableState.Advanced) ] // MDAC 69508
        static public Data/n ..... /n //View Source file for more details /n }

5. Example

Project: referencesource
Source File: DataColumnMappingCollection.cs
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);
            }
        }