public (IStorageEntry entry, IStorageState state) AddStorage(string name, string path, string type) { if (_settings.Storages.Any(s => s.Name == name)) { throw new ArgumentException("Name in use"); } var storage = new StorageEntry(name, type, path, Guid.NewGuid()); _settings.Storages.Add(storage); _settings.Store(); return(storage, new StorageState(storage, _settings.Store)); }
public StorageState(StorageEntry entry, Action store) { _entry = entry; _store = store; }