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);
        }
Esempio n. 2
0
 void IViewEvents.OnToggleBookmark()
 {
     bookmarks.ToggleBookmark(messagesPresenter.GetFocusedMessageBookmark());
 }
Esempio n. 3
0
        public Presenter(
            ILogSourcesManager logSources,
            Preprocessing.ILogSourcesPreprocessingManager preprocessingsManager,
            IView view,
            LogViewer.IPresenter viewerPresenter,
            SearchResult.IPresenter searchResultPresenter,
            SearchPanel.IPresenter searchPanelPresenter,
            SourcesList.IPresenter sourcesListPresenter,
            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,
            IShutdown shutdown
            )
        {
            this.tracer                = new LJTraceSource("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;

            view.SetPresenter(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.GetFocusedMessageBookmark();
                }
            };
            if (messagePropertiesDialogPresenter != null)
            {
                viewerPresenter.DefaultFocusedMessageActionCaption = "Show properties...";
                viewerPresenter.DefaultFocusedMessageAction       += (s, e) =>
                {
                    messagePropertiesDialogPresenter.ShowDialog();
                };
            }

            if (searchResultPresenter != null)
            {
                searchResultPresenter.OnClose           += (sender, args) => searchPanelPresenter.CollapseSearchResultPanel();
                searchResultPresenter.OnResizingStarted += (sender, args) => view.BeginSplittingSearchResults();
            }

            sourcesListPresenter.OnBusyState += (_, evt) => SetWaitState(evt.BusyStateRequired);

            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));
                }
            };
            sourcesManagerPresenter.OnViewUpdated += (sender, evt) =>
            {
                UpdateMillisecondsDisplayMode();
            };

            logSources.OnLogSourceAdded += (sender, evt) =>
            {
                UpdateFormCaption();
            };
            logSources.OnLogSourceRemoved += (sender, evt) =>
            {
                UpdateFormCaption();
            };

            if (autoUpdater != null)
            {
                autoUpdater.Changed += (sender, args) =>
                {
                    UpdateAutoUpdateIcon();
                };
            }

            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);
        }