Class StorageBagDirectory<T>
StorageBagDirectory<T> represents a directory in StorageManager with set of Eco.Core.Serialization.StorageBag entries. Each bag contains up to MaxItemsPerBag items.
Intended for cases where lot of items may exists to reduce number of storage handles in Zip Archive. Zip archive slow downs and can even crash if too many entries.
Inheritance
System.Object
StorageBagDirectory<T>
Assembly: Eco.Core.dll
Syntax
public class StorageBagDirectory<T> : Object
Type Parameters
Constructors
StorageBagDirectory(StorageManager, String, Int32)
Declaration
public StorageBagDirectory(StorageManager storageManager, string name, int maxItemsPerBag)
Parameters
| Type |
Name |
Description |
| StorageManager |
storageManager |
|
| System.String |
name |
|
| System.Int32 |
maxItemsPerBag |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
MaxItemsPerBag
Declaration
public int MaxItemsPerBag { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Name
Declaration
public string Name { get; }
Property Value
| Type |
Description |
| System.String |
|
StorageManager
Declaration
public StorageManager StorageManager { get; }
Property Value
Methods
Add(T)
Adds item to one of storage bags in the directory.
Declaration
Parameters
| Type |
Name |
Description |
| T |
item |
|
LoadInParallel()
Loads all storage dir items in parallel.
Declaration
public void LoadInParallel()
MarkAllDirty()
Marks all storage bags as dirty to be re-saved.
Declaration
public void MarkAllDirty()
MarkDirty(T)
Declaration
public void MarkDirty(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Modify<TObj>(TObj, Action<TObj>)
Modifies obj in a way preventing partial object saving.
Declaration
public void Modify<TObj>(TObj obj, Action<TObj> modify)
where TObj : T
Parameters
| Type |
Name |
Description |
| TObj |
obj |
|
| System.Action<TObj> |
modify |
|
Type Parameters
Remove(T)
Removes item from the directory.
Declaration
public bool Remove(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Returns
| Type |
Description |
| System.Boolean |
false if item wasn't added to the directory.
|
Extension Methods