public LogFileInfoFactory(IWurmLogDefinitions wurmLogDefinitions, ILogger logger) { if (wurmLogDefinitions == null) throw new ArgumentNullException("wurmLogDefinitions"); if (logger == null) throw new ArgumentNullException("logger"); this.wurmLogDefinitions = wurmLogDefinitions; this.logger = logger; }
internal WurmLogFiles(IWurmCharacterDirectories wurmCharacterDirectories, IWurmApiLogger logger, IWurmLogDefinitions wurmLogDefinitions, [NotNull] IInternalEventAggregator eventAggregator, [NotNull] IInternalEventInvoker internalEventInvoker, [NotNull] TaskManager taskManager, [NotNull] IWurmPaths wurmPaths) { if (wurmCharacterDirectories == null) { throw new ArgumentNullException(nameof(wurmCharacterDirectories)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (wurmLogDefinitions == null) { throw new ArgumentNullException(nameof(wurmLogDefinitions)); } if (eventAggregator == null) { throw new ArgumentNullException(nameof(eventAggregator)); } if (internalEventInvoker == null) { throw new ArgumentNullException(nameof(internalEventInvoker)); } if (taskManager == null) { throw new ArgumentNullException(nameof(taskManager)); } if (wurmPaths == null) { throw new ArgumentNullException(nameof(wurmPaths)); } this.wurmCharacterDirectories = wurmCharacterDirectories; this.logger = logger; this.wurmLogDefinitions = wurmLogDefinitions; this.eventAggregator = eventAggregator; this.internalEventInvoker = internalEventInvoker; this.taskManager = taskManager; this.wurmPaths = wurmPaths; try { Refresh(); } catch (Exception exception) { logger.Log(LogLevel.Error, "Error at initial WurmLogFiles refresh", this, exception); } eventAggregator.Subscribe(this); taskHandle = new TaskHandle(Refresh, "WurmLogFiles refresh"); taskManager.Add(taskHandle); taskHandle.Trigger(); }
public LogFileInfoFactory(IWurmLogDefinitions wurmLogDefinitions, IWurmApiLogger logger) { if (wurmLogDefinitions == null) { throw new ArgumentNullException(nameof(wurmLogDefinitions)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } this.wurmLogDefinitions = wurmLogDefinitions; this.logger = logger; }