public FileBasedGameResultRepository(
     AsyncSemaphore asyncMutex,
     IDeckFileStorage deckFileStorage)
 {
     _asyncMutex      = asyncMutex.Require(nameof(asyncMutex));
     _deckFileStorage = deckFileStorage.Require(nameof(deckFileStorage));
 }
 public FileBasedConfigurationStorage(
     AsyncSemaphore asyncMutex,
     ISerializer <Models.Data.ConfigurationData> configurationDataSerializer,
     string filePath)
 {
     _asyncMutex = asyncMutex.Require(nameof(asyncMutex));
     _configurationDataSerializer = configurationDataSerializer.Require(nameof(configurationDataSerializer));
     _filePath = filePath.Require(nameof(filePath));
 }
Exemple #3
0
        public FileBasedPowerLogManager(
            AsyncSemaphore asyncMutex,
            IConfigurationSource configurationSource,
            string directoryPath,
            string manifestFileName,
            ICollectionSerializer <Models.Data.SavedLog> savedLogCollectionSerializer,
            IEventDispatcher viewEventDispatcher)
        {
            _asyncMutex                   = asyncMutex.Require(nameof(asyncMutex));
            _configurationSource          = configurationSource.Require(nameof(configurationSource));
            _directoryPath                = directoryPath.Require(nameof(directoryPath));
            _manifestFileName             = manifestFileName.Require(nameof(manifestFileName));
            _savedLogCollectionSerializer = savedLogCollectionSerializer.Require(nameof(savedLogCollectionSerializer));
            _viewEventDispatcher          = viewEventDispatcher.Require(nameof(viewEventDispatcher));

            _powerLogFilePath = _configurationSource.GetSettings().PowerLogFilePath;

            _eventHandlers.Add(
                new DelegateEventHandler <ViewEvents.ConfigurationSettingsSaved>(
                    __event => _powerLogFilePath = _configurationSource.GetSettings().PowerLogFilePath));

            _eventHandlers.ForEach(__eventHandler => _viewEventDispatcher.RegisterHandler(__eventHandler));
        }