コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
 }