public Presenter( IBookmarks bookmarks, IView view, LogViewer.IPresenter viewerPresenter, SearchResult.IPresenter searchResultPresenter, BookmarksList.IPresenter listPresenter, StatusReports.IPresenter statusReportFactory, IPresentersFacade navHandler, IAlertPopup alerts, ITraceSourceFactory traceSourceFactory ) { this.bookmarks = bookmarks; this.view = view; this.viewerPresenter = viewerPresenter; this.tracer = traceSourceFactory.CreateTraceSource("UI", "ui.bmkm"); this.statusReportFactory = statusReportFactory; this.searchResultPresenter = searchResultPresenter; this.navHandler = navHandler; this.listPresenter = listPresenter; this.alerts = alerts; listPresenter.Click += (s, bmk) => { IPresenter myPublicIntf = this; myPublicIntf.NavigateToBookmark(bmk, BookmarkNavigationOptions.EnablePopups | BookmarkNavigationOptions.BookmarksStringsSet); }; view.SetPresenter(this); }
public Presenter( IBookmarks bookmarks, IView view, LogViewer.IPresenter viewerPresenter, SearchResult.IPresenter searchResultPresenter, BookmarksList.IPresenter listPresenter, StatusReports.IPresenter statusReportFactory, IPresentersFacade navHandler, IViewUpdates viewUpdates, IAlertPopup alerts) { this.bookmarks = bookmarks; this.view = view; this.viewerPresenter = viewerPresenter; this.tracer = new LJTraceSource("UI", "ui.bmkm"); this.statusReportFactory = statusReportFactory; this.searchResultPresenter = searchResultPresenter; this.viewUpdates = viewUpdates; this.navHandler = navHandler; this.listPresenter = listPresenter; this.alerts = alerts; viewerPresenter.FocusedMessageBookmarkChanged += delegate(object sender, EventArgs args) { listPresenter.SetMasterFocusedMessage(viewerPresenter.GetFocusedMessageBookmark()); }; listPresenter.Click += (s, bmk) => { IPresenter myPublicIntf = this; myPublicIntf.NavigateToBookmark(bmk, BookmarkNavigationOptions.EnablePopups | BookmarkNavigationOptions.BookmarksStringsSet); }; view.SetPresenter(this); }
public Presenter( IView view, ISearchManager searchManager, ISearchHistory searchHistory, IUserDefinedSearches userDefinedSearches, ILogSourcesManager sourcesManager, IFiltersFactory filtersFactory, ISearchResultsPanelView searchResultsPanelView, LoadedMessages.IPresenter loadedMessagesPresenter, SearchResult.IPresenter searchResultPresenter, StatusReports.IPresenter statusReportFactory, SearchEditorDialog.IPresenter searchEditorDialog, SearchesManagerDialog.IPresenter searchesManagerDialog, IAlertPopup alerts ) { this.view = view; this.searchManager = searchManager; this.searchHistory = searchHistory; this.filtersFactory = filtersFactory; this.searchResultsPanelView = searchResultsPanelView; this.loadedMessagesPresenter = loadedMessagesPresenter; this.searchResultPresenter = searchResultPresenter; this.statusReportFactory = statusReportFactory; this.sourcesManager = sourcesManager; this.searchesManagerDialog = searchesManagerDialog; this.alerts = alerts; this.quickSearchPresenter = new QuickSearchTextBox.Presenter(view.SearchTextBox); this.searchEditorDialog = searchEditorDialog; InvalidateSearchHistoryList(); searchHistory.OnChanged += (sender, args) => InvalidateSearchHistoryList(); sourcesManager.OnLogSourceAdded += (sender, e) => UpdateSearchControls(); sourcesManager.OnLogSourceRemoved += (sender, e) => UpdateSearchControls(); UpdateSearchControls(); UpdateUserDefinedSearchDependentControls(false); view.SetPresenter(this); quickSearchPresenter.OnSearchNow += (sender, args) => { if (quickSearchPresenter.Text != "") { DoSearch(reverseDirection: args.ReverseSearchModifier); } }; quickSearchPresenter.OnCancelled += (sender, args) => { bool searchCancelled = false; foreach (var r in searchManager.Results.Where(r => r.Status == SearchResultStatus.Active)) { r.Cancel(); searchCancelled = true; } if (!searchCancelled && InputFocusAbandoned != null) { InputFocusAbandoned(this, EventArgs.Empty); } }; quickSearchPresenter.SetSuggestionsHandler((sender, e) => { if (e.Etag == searchListEtag) { return; } foreach (var i in searchHistory.Items) { var description = new StringBuilder(); GetUserFriendlySearchHistoryEntryDescription(i, description); e.AddItem(new QuickSearchTextBox.SuggestionItem() { DisplayString = description.ToString(), SearchString = (i as ISimpleSearchHistoryEntry)?.Options.Template, Category = "recent searches", Data = i }); } foreach (var i in userDefinedSearches.Items) { var description = new StringBuilder(); GetUserFriendlySearchHistoryEntryDescription(i, description); e.AddItem(new QuickSearchTextBox.SuggestionItem() { DisplayString = description.ToString(), LinkText = "edit", Category = "Filters", Data = i }); } e.ConfigureCategory("Filters", linkText: "manage", alwaysVisible: true); e.Etag = searchListEtag; }); quickSearchPresenter.OnCurrentSuggestionChanged += (sender, e) => { var datum = quickSearchPresenter.CurrentSuggestion?.Data; var searchHistoryEntry = datum as ISimpleSearchHistoryEntry; if (searchHistoryEntry != null) { ReadControlsFromSelectedHistoryEntry(searchHistoryEntry); } UpdateUserDefinedSearchDependentControls( datum is IUserDefinedSearch || datum is IUserDefinedSearchHistoryEntry); }; quickSearchPresenter.OnSuggestionLinkClicked += (sender, e) => { var uds = e.Suggestion.Data as IUserDefinedSearch; if (uds == null) { return; } searchEditorDialog.Open(uds); }; quickSearchPresenter.OnCategoryLinkClicked += (sender, e) => { HandleSearchesManagerDialog(); }; userDefinedSearches.OnChanged += (sender, e) => { InvalidateSearchHistoryList(); }; }
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); }