Ejemplo n.º 1
0
        protected override void ChangeTargetStorage(Storage newStorage)
        {
            var lastStorage = UnderlyingStorage;

            base.ChangeTargetStorage(newStorage);

            if (lastStorage != null)
            {
                // for now we assume that if there was a previous storage, this is a migration operation.
                // the logger shouldn't be set during initialisation as it can cause cross-talk in tests (due to being static).
                Logger.Storage = UnderlyingStorage.GetStorageForDirectory("logs");
            }
        }
Ejemplo n.º 2
0
        public TournamentStorage(Storage storage)
            : base(storage.GetStorageForDirectory("tournaments"), string.Empty)
        {
            this.storage = storage;

            storageConfig = new TournamentStorageManager(storage);

            if (storage.Exists("tournament.ini"))
            {
                ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(storageConfig.Get <string>(StorageConfig.CurrentTournament)));
            }
            else
            {
                Migrate(UnderlyingStorage.GetStorageForDirectory(default_tournament));
            }

            Logger.Log("Using tournament storage: " + GetFullPath(string.Empty));
        }
 protected override void ChangeTargetStorage(Storage newStorage)
 {
     base.ChangeTargetStorage(newStorage);
     Logger.Storage = UnderlyingStorage.GetStorageForDirectory("logs");
 }
Ejemplo n.º 4
0
 // UnderlyingStore would always yield no results from the root directory.
 // Might be a bug on the framework's end since it only checks for subdirectories.
 public IEnumerable <string> GetAvailableResources()
 => UnderlyingStorage
 .GetDirectories(string.Empty)
 .Append(string.Empty)
 .SelectMany(d => UnderlyingStorage.GetFiles(d))
 .Where(p => filters?.Contains(Path.GetExtension(p)) ?? false);