예제 #1
0
        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));
        }
예제 #2
0
 public StorageState(StorageEntry entry, Action store)
 {
     _entry = entry;
     _store = store;
 }