GetDependency() private method

private GetDependency ( ) : System.Data.DataColumn[]
return System.Data.DataColumn[]
コード例 #1
0
ファイル: Select.cs プロジェクト: zadixon/corefx
 // Initialize candidate columns to new columnInfo and leave all non candidate columns to null
 private void InitCandidateColumns()
 {
     _nCandidates      = 0;
     _candidateColumns = new ColumnInfo[_table.Columns.Count];
     if (_rowFilter == null)
     {
         return;
     }
     DataColumn[] depColumns = _rowFilter.GetDependency();
     for (int i = 0; i < depColumns.Length; i++)
     {
         if (depColumns[i].Table == _table)
         {
             _candidateColumns[depColumns[i].Ordinal] = new ColumnInfo();
             _nCandidates++;
         }
     }
 }
コード例 #2
0
ファイル: DataColumn.cs プロジェクト: chcosta/corefx
        internal void HandleDependentColumnList(DataExpression oldExpression, DataExpression newExpression)
        {
            DataColumn[] dependency;

            // remove this column from the dependentColumn list of the columns this column depends on.
            if (oldExpression != null)
            {
                dependency = oldExpression.GetDependency();
                foreach (DataColumn col in dependency)
                {
                    Debug.Assert(null != col, "null datacolumn in expression dependencies");
                    col.RemoveDependentColumn(this);
                    if (col._table != _table)
                    {
                        _table.RemoveDependentColumn(this);
                    }
                }
                _table.RemoveDependentColumn(this);
            }

            if (newExpression != null)
            {
                // get the list of columns that this expression depends on
                dependency = newExpression.GetDependency();
                // add this column to dependent column list of each column this column depends on
                foreach (DataColumn col in dependency)
                {
                    col.AddDependentColumn(this);
                    if (col._table != _table)
                    {
                        _table.AddDependentColumn(this);
                    }
                }
                _table.AddDependentColumn(this);
            }
        }