public static void Remove(this ITableCellCache cache, string database, int tableId, int rowNumber, int columnOffset) { var rowId = new RowId(tableId, rowNumber); var key = new CellKey(database, new CellId(rowId, columnOffset)); cache.Remove(key); }
public static void Set(this ITableCellCache cache, string database, int tableId, int rowNumber, int columnOffset, Field value) { var rowId = new RowId(tableId, rowNumber); var key = new CellKey(database, new CellId(rowId, columnOffset)); cache.Set(new CachedCell(key, value)); }
public static bool TryGetValue(this ITableCellCache cache, string database, int tableId, int rowNumber, int columnOffset, out Field value) { var rowId = new RowId(tableId, rowNumber); var key = new CellKey(database, new CellId(rowId, columnOffset)); return(cache.TryGetValue(key, out value)); }
private Field CalcValue(int row, int column, ITableCellCache cache) { var resolver = varResolver.ForRow(row); if (groupResolver != null) { groupResolver.SetUpGroupForRow(row); } var expr = expList[column]; var exp = expr.Evaluate(context, resolver, groupResolver); if (exp.ExpressionType != SqlExpressionType.Constant) { throw new ArgumentException(); } var value = ((SqlConstantExpression)exp).Value; if (cache != null) { cache.Set(context.Query.Session.Transaction.Database.Name, uniqueId, row, column, value); } return(value); }
private DataObject CalcValue(int row, int column, ITableCellCache cache) { var resolver = varResolver.ForRow(row); if (groupResolver != null) { groupResolver.SetUpGroupForRow(row); } var expr = expList[column]; var exp = expr.Evaluate(context, resolver, groupResolver); if (exp.ExpressionType != SqlExpressionType.Constant) throw new ArgumentException(); var value = ((SqlConstantExpression) exp).Value; if (cache != null) cache.Set(context.Query.Session.Transaction.Database.Name, uniqueId, row, column, value); return value; }
void IServiceResolveContext.OnResolved(Type type, string name, object obj) { if (obj is ITableCellCache) cellCache = (ITableCellCache) obj; if (obj != null && obj is IConfigurable) ((IConfigurable)obj).Configure(Configuration); }