コード例 #1
0
        private Func <int, object> GetValidRowFetcherDelegate(Table table, IBindingType typeToConvertTo, CultureInfo cultureInfo)
        {
            if (table.RowCount == 0)
            {
                return(x => null);
            }

            var pivotTable = new PivotTable(table);

            if (stepArgumentTypeConverter.CanConvert(pivotTable.GetInstanceTable(0), typeToConvertTo, cultureInfo))
            {
                return(x => pivotTable.GetInstanceTable(x));
            }

            if (table.Header.Count == 1 &&
                stepArgumentTypeConverter.CanConvert(table.Rows[0][0], typeToConvertTo, cultureInfo))
            {
                return(x => table.Rows[x][0]);
            }

            return(null);
        }
コード例 #2
0
        private static Table PivotThisTable(Table setTable, int index)
        {
            var pivotTable = new PivotTable(setTable);

            return(pivotTable.GetInstanceTable(index));
        }