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

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

Private Properties

Свойство Тип Описание
AssignName string
InternalIndexOf int
MakeName string
RegisterName void
UnregisterName void

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

Метод Описание
Add ( DataColumn parentColumns, DataColumn childColumns ) : DataRelation

Creates a relation given the parameters and adds it to the collection. The name is defaulted. An ArgumentException is thrown if this relation already belongs to this collection or belongs to another collection. An InvalidConstraintException is thrown if the relation can't be created based on the parameters. The CollectionChanged event is fired if it succeeds.

Add ( string name, DataColumn parentColumns, DataColumn childColumns ) : DataRelation

Creates a with the specified name, parent columns, child columns, and adds it to the collection.

Add ( string name, DataColumn parentColumns, DataColumn childColumns, bool createConstraints ) : DataRelation

Creates a relation given the parameters and adds it to the collection. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation already belongs to this collection, belongs to another collection, or if this collection already has a relation with the same name (case insensitive). An InvalidRelationException is thrown if the relation can't be created based on the parameters. The CollectionChanged event is fired if it succeeds.

Add ( DataRelation relation ) : void

Adds the relation to the collection.

AddRange ( DataRelation relations ) : void
CanRemove ( DataRelation relation ) : bool

Verifies if a given relation can be removed from the collection.

Clear ( ) : void

Clears the collection of any relations.

Contains ( string name ) : bool

Returns true if this collection has a relation with the given name (case insensitive), false otherwise.

CopyTo ( DataRelation array, int index ) : void
IndexOf ( DataRelation relation ) : int

Returns the index of a specified .

IndexOf ( string relationName ) : int

Returns the index of the relation with the given name (case insensitive), or -1 if the relation doesn't exist in the collection.

Remove ( DataRelation relation ) : void

Removes the given relation from the collection. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation doesn't belong to this collection. The CollectionChanged event is fired if it succeeds.

Remove ( string name ) : void

Removes the relation with the given name from the collection. An IndexOutOfRangeException is thrown if this collection doesn't have a relation with that name The CollectionChanged event is fired if it succeeds.

RemoveAt ( int index ) : void

Removes the relation at the given index from the collection. An IndexOutOfRangeException is thrown if this collection doesn't have a relation at this index. The CollectionChanged event is fired if it succeeds.

this ( int index ) : DataRelation

Gets the relation specified by index.

this ( string name ) : DataRelation

Gets the relation specified by name.

Защищенные методы

Метод Описание
AddCore ( DataRelation relation ) : void

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

GetDataSet ( ) : DataSet

Gets the dataSet for this collection.

OnCollectionChanged ( CollectionChangeEventArgs ccevent ) : void

This method is called whenever the collection changes. Overriders of this method should call the base implementation of this method.

OnCollectionChanging ( CollectionChangeEventArgs ccevent ) : void
RemoveCore ( DataRelation relation ) : void

Does verification on the relation. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation doesn't belong to this collection.

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

Метод Описание
AssignName ( ) : string

Creates a new default name.

InternalIndexOf ( string name ) : int
MakeName ( int index ) : string

Makes a default name with the given index. e.g. Relation1, Relation2, ... Relationi

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 Relation.RelationName 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 Relation.RelationName 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() публичный Метод

Creates a relation given the parameters and adds it to the collection. The name is defaulted. An ArgumentException is thrown if this relation already belongs to this collection or belongs to another collection. An InvalidConstraintException is thrown if the relation can't be created based on the parameters. The CollectionChanged event is fired if it succeeds.
public Add ( DataColumn parentColumns, DataColumn childColumns ) : DataRelation
parentColumns DataColumn
childColumns DataColumn
Результат DataRelation

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

Creates a with the specified name, parent columns, child columns, and adds it to the collection.
public Add ( string name, DataColumn parentColumns, DataColumn childColumns ) : DataRelation
name string
parentColumns DataColumn
childColumns DataColumn
Результат DataRelation

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

Creates a relation given the parameters and adds it to the collection. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation already belongs to this collection, belongs to another collection, or if this collection already has a relation with the same name (case insensitive). An InvalidRelationException is thrown if the relation can't be created based on the parameters. The CollectionChanged event is fired if it succeeds.
public Add ( string name, DataColumn parentColumns, DataColumn childColumns, bool createConstraints ) : DataRelation
name string
parentColumns DataColumn
childColumns DataColumn
createConstraints bool
Результат DataRelation

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

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

AddCore() защищенный Метод

Does verification on the table. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation already belongs to this collection, belongs to another collection. A DuplicateNameException is thrown if this collection already has a relation with the same name (case insensitive).
protected AddCore ( DataRelation relation ) : void
relation DataRelation
Результат void

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

public AddRange ( DataRelation relations ) : void
relations DataRelation
Результат void

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

Verifies if a given relation can be removed from the collection.
public CanRemove ( DataRelation relation ) : bool
relation DataRelation
Результат bool

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

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

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

Returns true if this collection has a relation with the given name (case insensitive), false otherwise.
public Contains ( string name ) : bool
name string
Результат bool

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

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

GetDataSet() защищенный абстрактный Метод

Gets the dataSet for this collection.
protected abstract GetDataSet ( ) : DataSet
Результат DataSet

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

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

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

Returns the index of the relation with the given name (case insensitive), or -1 if the relation doesn't exist in the collection.
public IndexOf ( string relationName ) : int
relationName string
Результат int

OnCollectionChanged() защищенный Метод

This method is called whenever the collection changes. Overriders of this method should call the base implementation of this method.
protected OnCollectionChanged ( CollectionChangeEventArgs ccevent ) : void
ccevent System.ComponentModel.CollectionChangeEventArgs
Результат void

OnCollectionChanging() защищенный Метод

protected OnCollectionChanging ( CollectionChangeEventArgs ccevent ) : void
ccevent System.ComponentModel.CollectionChangeEventArgs
Результат void

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

Removes the given relation from the collection. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation doesn't belong to this collection. The CollectionChanged event is fired if it succeeds.
public Remove ( DataRelation relation ) : void
relation DataRelation
Результат void

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

Removes the relation with the given name from the collection. An IndexOutOfRangeException is thrown if this collection doesn't have a relation with that name The CollectionChanged event is fired if it succeeds.
public Remove ( string name ) : void
name string
Результат void

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

Removes the relation at the given index from the collection. An IndexOutOfRangeException is thrown if this collection doesn't have a relation at this index. The CollectionChanged event is fired if it succeeds.
public RemoveAt ( int index ) : void
index int
Результат void

RemoveCore() защищенный Метод

Does verification on the relation. An ArgumentNullException is thrown if this relation is null. An ArgumentException is thrown if this relation doesn't belong to this collection.
protected RemoveCore ( DataRelation relation ) : void
relation DataRelation
Результат void

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

Gets the relation specified by index.
public abstract this ( int index ) : DataRelation
index int
Результат DataRelation

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

Gets the relation specified by name.
public abstract this ( string name ) : DataRelation
name string
Результат DataRelation