public Presenter( ILogSourcesManager logSources, IUserDefinedFormatsManager udfManager, IRecentlyUsedEntities mru, Preprocessing.IManager logSourcesPreprocessings, IView view, Preprocessing.IStepsFactory preprocessingStepsFactory, Workspaces.IWorkspacesManager workspacesManager, SourcesList.IPresenter sourcesListPresenter, NewLogSourceDialog.IPresenter newLogSourceDialogPresenter, IHeartBeatTimer heartbeat, SharingDialog.IPresenter sharingDialogPresenter, HistoryDialog.IPresenter historyDialogPresenter, IPresentersFacade facade, SourcePropertiesWindow.IPresenter sourcePropertiesWindowPresenter, IAlertPopup alerts, ITraceSourceFactory traceSourceFactory, IChangeNotification changeNotification ) { this.logSources = logSources; this.udfManager = udfManager; this.mru = mru; this.view = view; this.logSourcesPreprocessings = logSourcesPreprocessings; this.preprocessingStepsFactory = preprocessingStepsFactory; this.workspacesManager = workspacesManager; this.newLogSourceDialogPresenter = newLogSourceDialogPresenter; this.sourcesListPresenter = sourcesListPresenter; this.tracer = traceSourceFactory.CreateTraceSource("UI", "smgr-ui"); this.sharingDialogPresenter = sharingDialogPresenter; this.historyDialogPresenter = historyDialogPresenter; this.sourcePropertiesWindowPresenter = sourcePropertiesWindowPresenter; this.alerts = alerts; this.presentersFacade = facade; this.changeNotification = changeNotification; sourcesListPresenter.DeleteRequested += (sender, args) => { DeleteSelectedSources(); }; logSourcesPreprocessings.PreprocessingAdded += (sender, args) => { if ((args.LogSourcePreprocessing.Flags & PreprocessingOptions.HighlightNewPreprocessing) != 0) { preprocessingAwaitingHighlighting = args.LogSourcePreprocessing; pendingUpdateFlag.Invalidate(); } }; heartbeat.OnTimer += (sender, args) => { if (pendingUpdateFlag.Validate()) { UpdateView(); } }; view.SetViewModel(this); }
public Presenter( ILogSourcesManager logSources, Preprocessing.IManager preprocessingsManager, IView view, LogViewer.IPresenterInternal viewerPresenter, SearchResult.IPresenter searchResultPresenter, SearchPanel.IPresenter searchPanelPresenter, SourcesManager.IPresenter sourcesManagerPresenter, MessagePropertiesDialog.IPresenter messagePropertiesDialogPresenter, LoadedMessages.IPresenter loadedMessagesPresenter, BookmarksManager.IPresenter bookmarksManagerPresenter, IHeartBeatTimer heartBeatTimer, ITabUsageTracker tabUsageTracker, StatusReports.IPresenter statusReportFactory, IDragDropHandler dragDropHandler, IPresentersFacade presentersFacade, IAutoUpdater autoUpdater, Progress.IProgressAggregator progressAggregator, IAlertPopup alerts, SharingDialog.IPresenter sharingDialogPresenter, IssueReportDialogPresenter.IPresenter issueReportDialogPresenter, IShutdownSource shutdown, IColorTheme theme, IChangeNotification changeNotification, ITraceSourceFactory traceSourceFactory ) { this.tracer = traceSourceFactory.CreateTraceSource("UI", "ui.main"); this.logSources = logSources; this.preprocessingsManager = preprocessingsManager; this.view = view; this.tabUsageTracker = tabUsageTracker; this.searchPanelPresenter = searchPanelPresenter; this.searchResultPresenter = searchResultPresenter; this.bookmarksManagerPresenter = bookmarksManagerPresenter; this.viewerPresenter = viewerPresenter; this.presentersFacade = presentersFacade; this.dragDropHandler = dragDropHandler; this.heartBeatTimer = heartBeatTimer; this.autoUpdater = autoUpdater; this.progressAggregator = progressAggregator; this.alerts = alerts; this.sharingDialogPresenter = sharingDialogPresenter; this.issueReportDialogPresenter = issueReportDialogPresenter; this.shutdown = shutdown; this.statusRepors = statusReportFactory; this.theme = theme; this.changeNotification = changeNotification; view.SetViewModel(this); viewerPresenter.ManualRefresh += delegate(object sender, EventArgs args) { using (tracer.NewFrame) { tracer.Info("----> User Command: Refresh"); logSources.Refresh(); } }; viewerPresenter.FocusedMessageBookmarkChanged += delegate(object sender, EventArgs args) { if (searchResultPresenter != null) { searchResultPresenter.MasterFocusedMessage = viewerPresenter.FocusedMessageBookmark; } }; if (messagePropertiesDialogPresenter != null) { viewerPresenter.DefaultFocusedMessageActionCaption = "Show properties..."; viewerPresenter.DefaultFocusedMessageAction += (s, e) => { messagePropertiesDialogPresenter.Show(); }; } if (searchResultPresenter != null) { searchResultPresenter.OnClose += (sender, args) => searchPanelPresenter.CollapseSearchResultPanel(); searchResultPresenter.OnResizingStarted += (sender, args) => view.BeginSplittingSearchResults(); } sourcesManagerPresenter.OnBusyState += (_, evt) => SetWaitState(evt.BusyStateRequired); searchPanelPresenter.InputFocusAbandoned += delegate(object sender, EventArgs args) { loadedMessagesPresenter.LogViewerPresenter.ReceiveInputFocus(); }; loadedMessagesPresenter.OnResizingStarted += (s, e) => view.BeginSplittingTabsPanel(); this.heartBeatTimer.OnTimer += (sender, e) => { if (e.IsRareUpdate) { SetAnalyzingIndication(logSources.Items.Any(s => s.TimeGaps.IsWorking)); } }; logSources.OnLogSourceAdded += (sender, evt) => { UpdateFormCaption(); }; logSources.OnLogSourceRemoved += (sender, evt) => { UpdateFormCaption(); }; progressAggregator.ProgressStarted += (sender, args) => { view.SetTaskbarState(TaskbarState.Progress); UpdateFormCaption(); }; progressAggregator.ProgressEnded += (sender, args) => { view.SetTaskbarState(TaskbarState.Idle); UpdateFormCaption(); }; progressAggregator.ProgressChanged += (sender, args) => { view.UpdateTaskbarProgress(args.ProgressPercentage); UpdateFormCaption(); }; if (sharingDialogPresenter != null) { sharingDialogPresenter.AvailabilityChanged += (sender, args) => { UpdateShareButton(); }; sharingDialogPresenter.IsBusyChanged += (sender, args) => { UpdateShareButton(); }; } ; UpdateFormCaption(); UpdateShareButton(); view.SetIssueReportingMenuAvailablity(issueReportDialogPresenter.IsAvailable); }
public Presenter( ILogSourcesManager logSources, IUserDefinedFormatsManager udfManager, IRecentlyUsedEntities mru, Preprocessing.ILogSourcesPreprocessingManager logSourcesPreprocessings, ILogSourcesController logSourcesController, IView view, Preprocessing.IPreprocessingStepsFactory preprocessingStepsFactory, Workspaces.IWorkspacesManager workspacesManager, SourcesList.IPresenter sourcesListPresenter, NewLogSourceDialog.IPresenter newLogSourceDialogPresenter, IHeartBeatTimer heartbeat, SharingDialog.IPresenter sharingDialogPresenter, HistoryDialog.IPresenter historyDialogPresenter, IPresentersFacade facade, SourcePropertiesWindow.IPresenter sourcePropertiesWindowPresenter, IAlertPopup alerts ) { this.logSources = logSources; this.udfManager = udfManager; this.logSourcesController = logSourcesController; this.mru = mru; this.view = view; this.logSourcesPreprocessings = logSourcesPreprocessings; this.preprocessingStepsFactory = preprocessingStepsFactory; this.workspacesManager = workspacesManager; this.newLogSourceDialogPresenter = newLogSourceDialogPresenter; this.sourcesListPresenter = sourcesListPresenter; this.tracer = new LJTraceSource("UI", "smgr-ui"); this.sharingDialogPresenter = sharingDialogPresenter; this.historyDialogPresenter = historyDialogPresenter; this.sourcePropertiesWindowPresenter = sourcePropertiesWindowPresenter; this.alerts = alerts; this.presentersFacade = facade; sourcesListPresenter.DeleteRequested += delegate(object sender, EventArgs args) { DeleteSelectedSources(); }; logSources.OnLogSourceAdded += (sender, args) => { UpdateRemoveAllButton(); }; logSources.OnLogSourceRemoved += (sender, args) => { updateTracker.Invalidate(); UpdateRemoveAllButton(); }; logSourcesPreprocessings.PreprocessingAdded += (sender, args) => { updateTracker.Invalidate(); UpdateRemoveAllButton(); if ((args.LogSourcePreprocessing.Flags & PreprocessingOptions.HighlightNewPreprocessing) != 0) { preprocessingAwaitingHighlighting = args.LogSourcePreprocessing; } }; logSourcesPreprocessings.PreprocessingDisposed += (sender, args) => { updateTracker.Invalidate(); UpdateRemoveAllButton(); }; logSourcesPreprocessings.PreprocessingChangedAsync += (sender, args) => { updateTracker.Invalidate(); }; sourcesListPresenter.SelectionChanged += delegate(object sender, EventArgs args) { bool anySourceSelected = sourcesListPresenter.SelectedSources.Any(); bool anyPreprocSelected = sourcesListPresenter.SelectedPreprocessings.Any(); view.EnableDeleteSelectedSourcesButton(anySourceSelected || anyPreprocSelected); view.EnableTrackChangesCheckBox(anySourceSelected); UpdateTrackChangesCheckBox(); view.SetPropertiesButtonState( sourcePropertiesWindowPresenter != null && sourcesListPresenter.SelectedSources.Count() == 1); }; logSources.OnLogSourceVisiblityChanged += (sender, args) => { updateTracker.Invalidate(); }; logSources.OnLogSourceAnnotationChanged += (sender, args) => { updateTracker.Invalidate(); }; logSources.OnLogSourceTrackingFlagChanged += (sender, args) => { updateTracker.Invalidate(); }; logSources.OnLogSourceStatsChanged += (sender, args) => { if ((args.Flags & (LogProviderStatsFlag.Error | LogProviderStatsFlag.CachedMessagesCount | LogProviderStatsFlag.State | LogProviderStatsFlag.BytesCount | LogProviderStatsFlag.BackgroundAcivityStatus)) != 0) { updateTracker.Invalidate(); } }; heartbeat.OnTimer += (sender, args) => { if (updateTracker.Validate()) { UpdateView(); } }; this.sharingDialogPresenter.AvailabilityChanged += (sender, args) => { UpdateShareButton(); }; this.sharingDialogPresenter.IsBusyChanged += (sender, args) => { UpdateShareButton(); }; view.SetPresenter(this); UpdateShareButton(); }