예제 #1
0
 public DeckFileStorage(
     ICollectionSerializer <Models.Data.Deck> deckCollectionSerializer,
     string filePath)
 {
     _deckCollectionSerializer = deckCollectionSerializer.Require(nameof(deckCollectionSerializer));
     _filePath = filePath.Require(nameof(filePath));
 }
예제 #2
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));
        }