Show / Hide Table of Contents

Class StorageManager

Inheritance
System.Object
StorageManager
Implements
IDisplayablePlugin
IHasDisplayTabs
IDisplayTab
IConfigurablePlugin
IEditablePlugin
IGUIPlugin
ICommandablePlugin
IThreadedPlugin
IShutdownablePlugin
IServerPlugin
IStorageManager
System.IDisposable
Namespace: Eco.Core.Plugins
Assembly: Eco.Core.dll
Syntax
[Priority(-200)]
public sealed class StorageManager : Singleton<StorageManager>, IDisplayablePlugin, IHasDisplayTabs, IDisplayTab, IConfigurablePlugin, IEditablePlugin, IGUIPlugin, ICommandablePlugin, IThreadedPlugin, IShutdownablePlugin, IServerPlugin, IStorageManager, IDisposable

Constructors

StorageManager()

Declaration
public StorageManager()

StorageManager(PluginConfig<StorageConfig>, IFileStorage, Boolean)

Declaration
public StorageManager(PluginConfig<StorageConfig> config, IFileStorage baseStorage, bool enableBackups = false)
Parameters
Type Name Description
PluginConfig<StorageConfig> config
IFileStorage baseStorage
System.Boolean enableBackups

Fields

GeneratingNewWorld

Declaration
public static bool GeneratingNewWorld
Field Value
Type Description
System.Boolean

Properties

Config

Declaration
public static StorageConfig Config { get; }
Property Value
Type Description
StorageConfig

ParamChanged

Declaration
public ThreadSafeAction<object, string> ParamChanged { get; set; }
Property Value
Type Description
ThreadSafeAction<System.Object, System.String>

PluginConfig

Declaration
public IPluginConfig PluginConfig { get; }
Property Value
Type Description
IPluginConfig

SaveName

Declaration
public static string SaveName { get; }
Property Value
Type Description
System.String

Storage

Declaration
public static IFileStorage Storage { get; }
Property Value
Type Description
IFileStorage

Methods

ClearDirtyState(IStorage)

Declaration
public void ClearDirtyState(IStorage storage)
Parameters
Type Name Description
IStorage storage

CreateStorageHandle(String, String)

Declaration
public IPersistent CreateStorageHandle(string folder, string name)
Parameters
Type Name Description
System.String folder
System.String name
Returns
Type Description
IPersistent

CreateTransientHandle()

Declaration
public IPersistent CreateTransientHandle()
Returns
Type Description
IPersistent

Delete(String)

Declaration
public static void Delete(string fileName)
Parameters
Type Name Description
System.String fileName

Dispose()

Declaration
public void Dispose()

FolderExists(String)

Declaration
public static bool FolderExists(string folder)
Parameters
Type Name Description
System.String folder
Returns
Type Description
System.Boolean

GetCategory()

Declaration
public string GetCategory()
Returns
Type Description
System.String

GetCommands(Dictionary<String, Action>)

Declaration
public void GetCommands(Dictionary<string, Action> nameToFunction)
Parameters
Type Name Description
System.Collections.Generic.Dictionary<System.String, System.Action> nameToFunction

GetDisplayText()

Declaration
public string GetDisplayText()
Returns
Type Description
System.String

GetEditObject()

Declaration
public object GetEditObject()
Returns
Type Description
System.Object

GetFiles(String)

Declaration
public static List<string> GetFiles(string folder)
Parameters
Type Name Description
System.String folder
Returns
Type Description
System.Collections.Generic.List<System.String>

GetStatus()

Declaration
public string GetStatus()
Returns
Type Description
System.String

IsDirty(IStorage)

Declaration
public bool IsDirty(IStorage storage)
Parameters
Type Name Description
IStorage storage
Returns
Type Description
System.Boolean

Load(String)

Declaration
public static Stream Load(string fileName)
Parameters
Type Name Description
System.String fileName
Returns
Type Description
System.IO.Stream

Load<T>(String, Action<T>)

Declaration
public static void Load<T>(string folder, Action<T> onLoad)
    where T : IStorage
Parameters
Type Name Description
System.String folder
System.Action<T> onLoad
Type Parameters
Name Description
T

LoadAndRemove<T>(String, Action<T, String>)

Loads object and removes entries from Eco.Core.Plugins.StorageManager.dataStore. May be used during conversion pass from old zip entries to new zip entries.

Declaration
public void LoadAndRemove<T>(string folder, Action<T, string> onLoad)
Parameters
Type Name Description
System.String folder
System.Action<T, System.String> onLoad
Type Parameters
Name Description
T

LoadAsync<T>(String, Action<T>)

Declaration
public void LoadAsync<T>(string folder, Action<T> onLoad)
    where T : IStorage
Parameters
Type Name Description
System.String folder
System.Action<T> onLoad
Type Parameters
Name Description
T

LoadOrCreate<TStorageType>(String, Action<TStorageType>)

Declaration
public static TStorageType LoadOrCreate<TStorageType>(string folder, Action<TStorageType> onCreate = null)
    where TStorageType : class, IStorage
Parameters
Type Name Description
System.String folder
System.Action<TStorageType> onCreate
Returns
Type Description
TStorageType
Type Parameters
Name Description
TStorageType

MarkDirty(IStorage)

Declaration
public void MarkDirty(IStorage storage)
Parameters
Type Name Description
IStorage storage

OnEditObjectChanged(Object, String)

Declaration
public void OnEditObjectChanged(object o, string param)
Parameters
Type Name Description
System.Object o
System.String param

PersistAsync()

Persists all pending storages asynchronously.

Declaration
public Task<TimeSpan> PersistAsync()
Returns
Type Description
System.Threading.Tasks.Task<System.TimeSpan>

PurgeAsync(String)

Declaration
public static Task PurgeAsync(string folder)
Parameters
Type Name Description
System.String folder
Returns
Type Description
System.Threading.Tasks.Task

Remove(IStorage)

Declaration
public void Remove(IStorage storage)
Parameters
Type Name Description
IStorage storage

Run()

Declaration
public void Run()

Save(String, Stream)

Declaration
public static void Save(string fileName, Stream data)
Parameters
Type Name Description
System.String fileName
System.IO.Stream data

Save(String, String)

Declaration
public static void Save(string fileName, string data)
Parameters
Type Name Description
System.String fileName
System.String data

SaveAndFlushAsync()

Declaration
public static Task SaveAndFlushAsync()
Returns
Type Description
System.Threading.Tasks.Task

ShutdownAsync()

Declaration
public Task ShutdownAsync()
Returns
Type Description
System.Threading.Tasks.Task

TempStorageManager(IFileStorage)

Declaration
public static Singleton<StorageManager>.Temp TempStorageManager(IFileStorage fileStorage)
Parameters
Type Name Description
IFileStorage fileStorage
Returns
Type Description
Singleton.Temp<>

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

UnlockSaveAndFlushAsync()

Declaration
public static Task UnlockSaveAndFlushAsync()
Returns
Type Description
System.Threading.Tasks.Task

WithTempStorageManager(IFileStorage, Action)

Declaration
public static void WithTempStorageManager(IFileStorage fileStorage, Action action)
Parameters
Type Name Description
IFileStorage fileStorage
System.Action action

Events

OnPersistAsync

Declaration
public static event Action OnPersistAsync
Event Type
Type Description
System.Action

OnSaveAllComplete

Declaration
public static event Action OnSaveAllComplete
Event Type
Type Description
System.Action

Implements

IDisplayablePlugin
IHasDisplayTabs
IDisplayTab
IConfigurablePlugin
IEditablePlugin
IGUIPlugin
ICommandablePlugin
IThreadedPlugin
IShutdownablePlugin
IServerPlugin
IStorageManager
System.IDisposable

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
☀
☾