Stores stuff (strings, ints, objects) in a very hidden worksheet of a workbook, and retrieves stuff from it. The store supports 'namespaces' where a worksheet can be used as a 'context', i.e. namespace. Empty context constitutes a global namespace. Uses a cache that is automatically written to the worksheet when finalizing.
More...
|
| Store () |
| Instantiates the class and associates it with the active workbook of the Excel instance that is currently associated with the add-in. More...
|
|
| Store (Workbook workbook) |
| Instantiates the class and associates it with a workbook. More...
|
|
| Store (bool activeSheetContext) |
| Creates a new Store instance with the active sheet as current context. More...
|
|
void | Dispose () |
|
int | Get (string key, int def, int min, int max) |
| Retrieves an integer from the storage, given a key. More...
|
|
string | Get (string key, string def) |
|
bool | Get (string key, bool def) |
|
T | Get< T > (string key) |
| Deserializes a stored object. Returns null upon failure. More...
|
|
void | Put (string key, int i) |
|
void | Put (string key, string s) |
|
void | Put (string key, bool b) |
|
void | Put< T > (string key, T obj) |
|
void | UseActiveSheet () |
| Sets the active sheet of the current workbook as the context. More...
|
|
bool | HasKey (string key) |
| Determines if the current context has a stored item with given key. More...
|
|
void | Flush () |
| Writes out the values to the hidden worksheet, if values were changed. More...
|
|
|
Workbook | Workbook [get, set] |
| Gets or sets the associated workbook. If a new workbook is set, writes the values to the old workbook, then reads the values from the new workbook. More...
|
|
string | Context [get, set] |
| Sets the context of the current storage object. This may be a worksheet name or an empty string for the global context of the workbook. More...
|
|
Worksheet | StoreSheet [get] |
|
bool | Dirty [get, set] |
|
Stores stuff (strings, ints, objects) in a very hidden worksheet of a workbook, and retrieves stuff from it. The store supports 'namespaces' where a worksheet can be used as a 'context', i.e. namespace. Empty context constitutes a global namespace. Uses a cache that is automatically written to the worksheet when finalizing.
◆ Store() [1/3]
XLToolbox.WorkbookStorage.Store.Store |
( |
| ) |
|
|
inline |
Instantiates the class and associates it with the active workbook of the Excel instance that is currently associated with the add-in.
- Exceptions
-
NoExcelInstanceException | If no Excel instance is running (see ExcelInstance). |
◆ Store() [2/3]
XLToolbox.WorkbookStorage.Store.Store |
( |
Workbook |
workbook | ) |
|
|
inline |
Instantiates the class and associates it with a workbook.
- Parameters
-
workbook | Workbook object to associate the storage with. |
◆ Store() [3/3]
XLToolbox.WorkbookStorage.Store.Store |
( |
bool |
activeSheetContext | ) |
|
|
inline |
Creates a new Store instance with the active sheet as current context.
- Parameters
-
activeSheetContext | True if the active sheet is the desired context. |
◆ Dispose() [1/2]
void XLToolbox.WorkbookStorage.Store.Dispose |
( |
| ) |
|
|
inline |
◆ Dispose() [2/2]
virtual void XLToolbox.WorkbookStorage.Store.Dispose |
( |
bool |
disposing | ) |
|
|
inlineprotectedvirtual |
◆ Flush()
void XLToolbox.WorkbookStorage.Store.Flush |
( |
| ) |
|
|
inline |
Writes out the values to the hidden worksheet, if values were changed.
◆ Get() [1/3]
int XLToolbox.WorkbookStorage.Store.Get |
( |
string |
key, |
|
|
int |
def, |
|
|
int |
min, |
|
|
int |
max |
|
) |
| |
|
inline |
Retrieves an integer from the storage, given a key.
- Parameters
-
- Returns
- Integer value
◆ Get() [2/3]
string XLToolbox.WorkbookStorage.Store.Get |
( |
string |
key, |
|
|
string |
def |
|
) |
| |
|
inline |
◆ Get() [3/3]
bool XLToolbox.WorkbookStorage.Store.Get |
( |
string |
key, |
|
|
bool |
def |
|
) |
| |
|
inline |
◆ Get< T >()
Deserializes a stored object. Returns null upon failure.
- Template Parameters
-
T | Type name of the object to be deserialized. |
- Parameters
-
key | Key that this object is stored under. |
- Returns
- Deserialized object of type T, or null.
◆ GetDynamicValue()
dynamic XLToolbox.WorkbookStorage.Store.GetDynamicValue |
( |
string |
key | ) |
|
|
inlineprotected |
◆ HasKey()
bool XLToolbox.WorkbookStorage.Store.HasKey |
( |
string |
key | ) |
|
|
inline |
Determines if the current context has a stored item with given key.
- Parameters
-
- Returns
- True if key exists in current context, false if not.
◆ Put() [1/3]
void XLToolbox.WorkbookStorage.Store.Put |
( |
string |
key, |
|
|
int |
i |
|
) |
| |
|
inline |
◆ Put() [2/3]
void XLToolbox.WorkbookStorage.Store.Put |
( |
string |
key, |
|
|
string |
s |
|
) |
| |
|
inline |
◆ Put() [3/3]
void XLToolbox.WorkbookStorage.Store.Put |
( |
string |
key, |
|
|
bool |
b |
|
) |
| |
|
inline |
◆ Put< T >()
◆ PutObject()
void XLToolbox.WorkbookStorage.Store.PutObject |
( |
string |
key, |
|
|
object |
o |
|
) |
| |
|
inlineprotected |
Central method to put objects into the store.
- Parameters
-
key | Key to store the object under. |
o | Object to store. |
◆ ReadFromWorksheet()
void XLToolbox.WorkbookStorage.Store.ReadFromWorksheet |
( |
| ) |
|
|
inlineprotected |
Reads all settings from the hidden storage worksheet
◆ UseActiveSheet()
void XLToolbox.WorkbookStorage.Store.UseActiveSheet |
( |
| ) |
|
|
inline |
Sets the active sheet of the current workbook as the context.
◆ WriteToWorksheet()
void XLToolbox.WorkbookStorage.Store.WriteToWorksheet |
( |
| ) |
|
|
inlineprotected |
Writes all settings to the hidden storage worksheet.
◆ Context
string XLToolbox.WorkbookStorage.Store.Context |
|
getset |
Sets the context of the current storage object. This may be a worksheet name or an empty string for the global context of the workbook.
◆ Dirty
bool XLToolbox.WorkbookStorage.Store.Dirty |
|
getsetprotected |
◆ StoreSheet
Worksheet XLToolbox.WorkbookStorage.Store.StoreSheet |
|
getprotected |
◆ Workbook
Workbook XLToolbox.WorkbookStorage.Store.Workbook |
|
getset |
Gets or sets the associated workbook. If a new workbook is set, writes the values to the old workbook, then reads the values from the new workbook.
The documentation for this class was generated from the following file: