public RowColumnsBindingSpaceExp(DataTable table, IRowEvaluator pEvaluator, string[] trigerCols, string pTopExp, string pSubCorrectExp, string[] pSubCols, string[] pSubExp, IRowsSelector pSelectorTop, IRowsSelector pSelectorBot, IRowValidator pValidator)
            : base(table, pValidator)
        {
            //
            columns = trigerCols;

            selectorTop = pSelectorTop;
            selectorBot = pSelectorBot;
            subCols     = pSubCols;
            subExp      = pSubExp;

            topExp        = string.Format(pTopExp, _TOP_VALUE_);
            subCoorectExp = string.Format(pSubCorrectExp, _TOP_VALUE_);
            for (int i = 0; i < subExp.Length; ++i)
            {
                subExp[i] = string.Format(subExp[i], _TOP_VALUE_);
            }

            //

            //
            evaluator = pEvaluator;
            evaluator.addVar(_TOP_VALUE_, typeof(double));
            evaluator.addExpression(nameTopExp, topExp, typeof(double));
            evaluator.addExpression(nameSubCoorectExp, subCoorectExp, typeof(double));
            for (int i = 0; i < pSubExp.Length; ++i)
            {
                evaluator.addExpression(getName(subCols[i]), subExp[i], typeof(double));
            }
            //

            tableSource.ColumnChanged += new DataColumnChangeEventHandler(table_ColumnChangedForRow);
        }
示例#2
0
 public RowColumnsBindingBase(DataTable table, string[] colArr, string col, string pExpr, IRowValidator pValidator)
     : base(table, pValidator)
 {
     pExpr     = string.Format(pExpr, colArr);
     columns   = colArr;
     column    = col;
     evaluator = new ImplRowEvaluator();
     for (int i = 0; i < columns.Length; ++i)
     {
         evaluator.addVar(columns[i], table.Columns[columns[i]].DataType);
     }
     evaluator.addExpression(column, pExpr, typeof(double));
 }