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 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 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));
        }
Пример #4
0
        public bool TryGetValue(CellKey key, out Field value)
        {
            lock (this) {
                var database    = key.Database;
                var tableKey    = key.RowId.TableId;
                var row         = key.RowId.RowNumber;
                var columnIndex = key.ColumnOffset;

                object obj;
                if (!cache.TryGet(new CacheKey(database, tableKey, row, (short)columnIndex), out obj))
                {
                    value = null;
                    return(false);
                }

                value = (Field)obj;
                return(true);
            }
        }
Пример #5
0
 internal CachedCell(CellKey key, DataObject value)
 {
     Key   = key;
     Value = value;
 }
Пример #6
0
 public void Remove(CellKey key)
 {
     Remove(key.Database, key.RowId.TableId, key.RowId.RowNumber, key.ColumnOffset);
 }
Пример #7
0
 internal CachedCell(CellKey key, Field value)
 {
     Key   = key;
     Value = value;
 }