Show / Hide Table of Contents

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>
Namespace: Eco.Core.Serialization
Assembly: Eco.Core.dll
Syntax
public class StorageBagDirectory<T> : Object
Type Parameters
Name Description
T

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
Type Description
StorageManager

Methods

Add(T)

Adds item to one of storage bags in the directory.

Declaration
public void Add(T item)
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
Name Description
TObj

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

PropertyChanges.FirePropertyChanged(Object, String)
PropertyChanges.FirePropertyChanged(Object, String, Object, Object)
PropertyChanges.FirePropertyChanged(Object, MemberChangedBeforeAfterEventArgs)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾