C# Class System.Data.ConstraintCollection

Inheritance: InternalDataCollectionBase
Afficher le fichier Open project: dotnet/corefx Class Usage Examples

Private Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

Add() public méthode

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
Résultat Constraint

Add() public méthode

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
Résultat Constraint

Add() public méthode

Adds the constraint to the collection.
public Add ( Constraint constraint ) : void
constraint Constraint
Résultat void

AddRange() public méthode

public AddRange ( Constraint constraints ) : void
constraints Constraint
Résultat void

CanRemove() public méthode

Indicates if a can be removed.
public CanRemove ( Constraint constraint ) : bool
constraint Constraint
Résultat bool

Clear() public méthode

Clears the collection of any objects.
public Clear ( ) : void
Résultat void

Contains() public méthode

Indicates whether the , specified by name, exists in the collection.
public Contains ( string name ) : bool
name string
Résultat bool

CopyTo() public méthode

public CopyTo ( Constraint array, int index ) : void
array Constraint
index int
Résultat void

IndexOf() public méthode

Returns the index of the specified .
public IndexOf ( Constraint constraint ) : int
constraint Constraint
Résultat int

IndexOf() public méthode

Returns the index of the , specified by name.
public IndexOf ( string constraintName ) : int
constraintName string
Résultat int

Remove() public méthode

Removes the specified from the collection.
public Remove ( Constraint constraint ) : void
constraint Constraint
Résultat void

Remove() public méthode

Removes the constraint, specified by name, from the collection.
public Remove ( string name ) : void
name string
Résultat void

RemoveAt() public méthode

Removes the constraint at the specified index from the collection.
public RemoveAt ( int index ) : void
index int
Résultat void

this() public méthode

Gets the from the collection at the specified index.
public this ( int index ) : Constraint
index int
Résultat Constraint

this() public méthode

Gets the from the collection with the specified name.
public this ( string name ) : Constraint
name string
Résultat Constraint