Beispiel #1
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));
        }
Beispiel #2
0
 public WaitHandle(
     AsyncSemaphore parent)
 {
     _parent = parent;
 }