Add() public method

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
return DataRelation
Exemplo n.º 1
0
        private uint Pop(CUQueue UQueue, ref DataRelationCollection drc)
        {
            int n;
            string str;
            bool b;
            int nData;
            uint nSize = UQueue.GetSize();
            UQueue.Load(out nData);
            drc.Clear();
            for (n = 0; n < nData; n++)
            {
                DataColumn[] dcsChild = null;
                PopTableColNamesOnly(UQueue, ref dcsChild);

                UQueue.Load(out b);
                UQueue.Load(out str);

                DataColumn[] dcsParent = null;
                PopTableColNamesOnly(UQueue, ref dcsParent);

                DataRelation dr = new DataRelation(str, dcsParent, dcsChild);
                dr.Nested = b;
                drc.Add(dr);
            }
            return (nSize - UQueue.GetSize());
        }