C# Класс System.Data.ConstraintCollection

Наследование: InternalDataCollectionBase
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Add void
AddForeignKeyConstraint void
AddUniqueConstraint void
ArrayAdd void
ArrayRemove void
AssignName string
AutoGenerated bool
BaseAdd void
BaseGroupSwitch void
BaseRemove void
CanRemove bool
CompareArrays bool
ConstraintCollection System.Diagnostics
Contains bool
FindConstraint Constraint
FindForeignKeyConstraint ForeignKeyConstraint
FindKeyConstraint UniqueConstraint
FinishInitConstraints void
InternalIndexOf int
MakeName string
OnCollectionChanged void
RegisterName void
UnregisterName void

Открытые методы

Метод Описание
Add ( string name, DataColumn primaryKeyColumn, DataColumn foreignKeyColumn ) : Constraint

Constructs a new with the specified parent and child columns and adds the constraint to the collection.

Add ( string name, DataColumn columns, bool primaryKey ) : Constraint

Constructs a new using the specified array of objects and adds it to the collection.

Add ( Constraint constraint ) : void

Adds the constraint to the collection.

AddRange ( Constraint constraints ) : void
CanRemove ( Constraint constraint ) : bool

Indicates if a can be removed.

Clear ( ) : void

Clears the collection of any objects.

Contains ( string name ) : bool

Indicates whether the , specified by name, exists in the collection.

CopyTo ( Constraint array, int index ) : void
IndexOf ( Constraint constraint ) : int

Returns the index of the specified .

IndexOf ( string constraintName ) : int

Returns the index of the , specified by name.

Remove ( Constraint constraint ) : void

Removes the specified from the collection.

Remove ( string name ) : void

Removes the constraint, specified by name, from the collection.

RemoveAt ( int index ) : void

Removes the constraint at the specified index from the collection.

this ( int index ) : Constraint

Gets the from the collection at the specified index.

this ( string name ) : Constraint

Gets the from the collection with the specified name.

Приватные методы

Метод Описание
Add ( Constraint constraint, bool addUniqueWhenAddingForeign ) : void
AddForeignKeyConstraint ( ForeignKeyConstraint constraint ) : void
AddUniqueConstraint ( UniqueConstraint constraint ) : void
ArrayAdd ( Constraint constraint ) : void

Adds the constraint to the constraints array.

ArrayRemove ( Constraint constraint ) : void
AssignName ( ) : string

Creates a new default name.

AutoGenerated ( Constraint constraint ) : bool
BaseAdd ( Constraint constraint ) : void

Does verification on the constraint and it's name. An ArgumentNullException is thrown if this constraint is null. An ArgumentException is thrown if this constraint already belongs to this collection, belongs to another collection. A DuplicateNameException is thrown if this collection already has a constraint with the same name (case insensitive).

BaseGroupSwitch ( Constraint oldArray, int oldLength, Constraint newArray, int newLength ) : void

BaseGroupSwitch will intelligently remove and add tables from the collection.

BaseRemove ( Constraint constraint ) : void

Does verification on the constraint and it's name. An ArgumentNullException is thrown if this constraint is null. An ArgumentException is thrown if this constraint doesn't belong to this collection or if this constraint is part of a relationship.

CanRemove ( Constraint constraint, bool fThrowException ) : bool
CompareArrays ( DataColumn a1, DataColumn a2 ) : bool
ConstraintCollection ( DataTable table ) : System.Diagnostics

ConstraintCollection constructor. Used only by DataTable.

Contains ( string name, bool caseSensitive ) : bool
FindConstraint ( Constraint constraint ) : Constraint

Returns a matching constriant object.

FindForeignKeyConstraint ( DataColumn parentColumns, DataColumn childColumns ) : ForeignKeyConstraint

Returns a matching constriant object.

FindKeyConstraint ( DataColumn columns ) : UniqueConstraint

Returns a matching constriant object.

FinishInitConstraints ( ) : void
InternalIndexOf ( string constraintName ) : int
MakeName ( int index ) : string

Makes a default name with the given index. e.g. Constraint1, Constraint2, ... Constrainti

OnCollectionChanged ( CollectionChangeEventArgs ccevent ) : void

Raises the event.

RegisterName ( string name ) : void

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 Constraint.ConstraintName property. if the name is equivalent to the next default name to hand out, we increment our defaultNameIndex.

UnregisterName ( string name ) : void

Unregisters this name as no longer being used in the collection. Called by Remove, All property, and Constraint.ConstraintName property. If the name is equivalent to the last proposed default name, we walk backwards to find the next proper default name to use.

Описание методов

Add() публичный Метод

Constructs a new with the specified parent and child columns and adds the constraint to the collection.
public Add ( string name, DataColumn primaryKeyColumn, DataColumn foreignKeyColumn ) : Constraint
name string
primaryKeyColumn DataColumn
foreignKeyColumn DataColumn
Результат Constraint

Add() публичный Метод

Constructs a new using the specified array of objects and adds it to the collection.
public Add ( string name, DataColumn columns, bool primaryKey ) : Constraint
name string
columns DataColumn
primaryKey bool
Результат Constraint

Add() публичный Метод

Adds the constraint to the collection.
public Add ( Constraint constraint ) : void
constraint Constraint
Результат void

AddRange() публичный Метод

public AddRange ( Constraint constraints ) : void
constraints Constraint
Результат void

CanRemove() публичный Метод

Indicates if a can be removed.
public CanRemove ( Constraint constraint ) : bool
constraint Constraint
Результат bool

Clear() публичный Метод

Clears the collection of any objects.
public Clear ( ) : void
Результат void

Contains() публичный Метод

Indicates whether the , specified by name, exists in the collection.
public Contains ( string name ) : bool
name string
Результат bool

CopyTo() публичный Метод

public CopyTo ( Constraint array, int index ) : void
array Constraint
index int
Результат void

IndexOf() публичный Метод

Returns the index of the specified .
public IndexOf ( Constraint constraint ) : int
constraint Constraint
Результат int

IndexOf() публичный Метод

Returns the index of the , specified by name.
public IndexOf ( string constraintName ) : int
constraintName string
Результат int

Remove() публичный Метод

Removes the specified from the collection.
public Remove ( Constraint constraint ) : void
constraint Constraint
Результат void

Remove() публичный Метод

Removes the constraint, specified by name, from the collection.
public Remove ( string name ) : void
name string
Результат void

RemoveAt() публичный Метод

Removes the constraint at the specified index from the collection.
public RemoveAt ( int index ) : void
index int
Результат void

this() публичный Метод

Gets the from the collection at the specified index.
public this ( int index ) : Constraint
index int
Результат Constraint

this() публичный Метод

Gets the from the collection with the specified name.
public this ( string name ) : Constraint
name string
Результат Constraint