System.Data.AggregateNode.Bind C# (CSharp) Méthode

Bind() static private méthode

static private Bind ( DataRelation relation, List list ) : void
relation DataRelation
list List
Résultat void
        internal static void Bind(DataRelation relation, List<DataColumn> list)
        {
            if (null != relation)
            {
                // add the ends of the relationship the expression depends on
                foreach (DataColumn c in relation.ChildColumnsReference)
                {
                    if (!list.Contains(c))
                    {
                        list.Add(c);
                    }
                }
                foreach (DataColumn c in relation.ParentColumnsReference)
                {
                    if (!list.Contains(c))
                    {
                        list.Add(c);
                    }
                }
            }
        }

Same methods

AggregateNode::Bind ( DataTable table, List list ) : void

Usage Example

Exemple #1
0
        internal override void Bind(DataTable table, List <DataColumn> list)
        {
            base.BindTable(table);
            this.column   = null;
            this.relation = null;
            if (table == null)
            {
                throw ExprException.ExpressionUnbound(this.ToString());
            }
            DataRelationCollection parentRelations = table.ParentRelations;

            if (this.relationName == null)
            {
                if (parentRelations.Count > 1)
                {
                    throw ExprException.UnresolvedRelation(table.TableName, this.ToString());
                }
                this.relation = parentRelations[0];
            }
            else
            {
                this.relation = parentRelations[this.relationName];
            }
            if (this.relation == null)
            {
                throw ExprException.BindFailure(this.relationName);
            }
            DataTable parentTable = this.relation.ParentTable;

            this.column = parentTable.Columns[this.columnName];
            if (this.column == null)
            {
                throw ExprException.UnboundName(this.columnName);
            }
            int num = 0;

            while (num < list.Count)
            {
                DataColumn column = list[num];
                if (this.column == column)
                {
                    break;
                }
                num++;
            }
            if (num >= list.Count)
            {
                list.Add(this.column);
            }
            AggregateNode.Bind(this.relation, list);
        }
All Usage Examples Of System.Data.AggregateNode::Bind