public Presenter(
            ILogSourcesManager logSources,
            IView view,
            ILogSourcesPreprocessingManager logSourcesPreprocessings,
            SourcePropertiesWindow.IPresenter propertiesWindowPresenter,
            LogViewer.IPresenter logViewerPresenter,
            IPresentersFacade navHandler,
            IAlertPopup alerts,
            IFileDialogs fileDialogs,
            IClipboardAccess clipboard,
            IShellOpen shellOpen,
            SaveJointLogInteractionPresenter.IPresenter saveJointLogInteractionPresenter
            )
        {
            this.logSources = logSources;
            this.view       = view;
            this.propertiesWindowPresenter = propertiesWindowPresenter;
            this.logViewerPresenter        = logViewerPresenter;
            this.logSourcesPreprocessings  = logSourcesPreprocessings;
            this.alerts      = alerts;
            this.fileDialogs = fileDialogs;
            this.clipboard   = clipboard;
            this.shellOpen   = shellOpen;
            this.saveJointLogInteractionPresenter = saveJointLogInteractionPresenter;

            logViewerPresenter.FocusedMessageChanged += (sender, args) =>
            {
                view.InvalidateFocusedMessageArea();
            };

            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);
        }
示例#3
0
        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);
        }
示例#4
0
 public Factory(
     IAlertPopup alerts,
     IFileDialogs fileDialogs,
     Help.IPresenter help,
     ILogProviderFactoryRegistry registry,
     IFormatDefinitionsRepository repo,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     ITempFilesManager tempFilesManager,
     ITraceSourceFactory traceSourceFactory,
     RegularExpressions.IRegexFactory regexFactory,
     LogViewer.IPresenterFactory logViewerPresenterFactory,
     IViewsFactory viewFactories,
     ISynchronizationContext synchronizationContext,
     FieldsProcessor.IFactory fieldsProcessorFactory
     )
 {
     this.viewFactories             = viewFactories;
     this.alerts                    = alerts;
     this.registry                  = registry;
     this.fileDialogs               = fileDialogs;
     this.userDefinedFormatsManager = userDefinedFormatsManager;
     this.help                      = help;
     this.repo                      = repo;
     this.tempFilesManager          = tempFilesManager;
     this.logViewerPresenterFactory = logViewerPresenterFactory;
     this.traceSourceFactory        = traceSourceFactory;
     this.regexFactory              = regexFactory;
     this.synchronizationContext    = synchronizationContext;
     this.fieldsProcessorFactory    = fieldsProcessorFactory;
 }
示例#5
0
        public Presenter(
            IView view,
            ILogSourcesManager logSources,
            Preprocessing.ILogSourcesPreprocessingManager preprocessings,
            IPresentersFacade navHandler,
            IAlertPopup alerts,
            IClipboardAccess clipboard,
            IShellOpen shellOpen
            )
        {
            this.view             = view;
            this.presentersFacade = navHandler;
            this.alerts           = alerts;
            this.preprocessings   = preprocessings;
            this.clipboard        = clipboard;
            this.shellOpen        = shellOpen;
            this.logSources       = logSources;

            view.SetEventsHandler(this);

            logSources.OnLogSourceColorChanged += (s, e) =>
            {
                if (object.ReferenceEquals(s, source) && currentWindow != null)
                {
                    UpdateColorPanel();
                }
            };
        }
        public static bool?TestParsing(
            string sampleLog,
            IAlertPopup alerts,
            ITempFilesManager tempFilesManager,
            IObjectFactory objectsFactory,
            XmlNode formatRoot,
            string formatSpecificNodeName
            )
        {
            if (sampleLog == "")
            {
                alerts.ShowPopup("", "Provide sample log first", AlertFlags.Ok | AlertFlags.WarningIcon);
                return(null);
            }

            string tmpLog = tempFilesManager.GenerateNewName();

            try
            {
                XDocument clonedFormatXmlDocument = XDocument.Parse(formatRoot.OuterXml);

                UserDefinedFactoryParams createParams;
                createParams.Entry              = null;
                createParams.RootNode           = clonedFormatXmlDocument.Element("format");
                createParams.FormatSpecificNode = createParams.RootNode.Element(formatSpecificNodeName);
                createParams.FactoryRegistry    = null;
                createParams.TempFilesManager   = tempFilesManager;

                // Temporary sample file is always written in Unicode wo BOM: we don't test encoding detection,
                // we test regexps correctness.
                using (var w = new StreamWriter(tmpLog, false, new UnicodeEncoding(false, false)))
                    w.Write(sampleLog);
                ChangeEncodingToUnicode(createParams);

                var cp = ConnectionParamsUtils.CreateFileBasedConnectionParamsFromFileName(tmpLog);

                ILogProviderFactory f;
                if (formatSpecificNodeName == "regular-grammar")
                {
                    f = new RegularGrammar.UserDefinedFormatFactory(createParams);
                }
                else if (formatSpecificNodeName == "xml")
                {
                    f = new XmlFormat.UserDefinedFormatFactory(createParams);
                }
                else
                {
                    return(null);
                }
                using (f as IDisposable)
                    using (var interaction = objectsFactory.CreateTestDialog())
                    {
                        return(interaction.ShowDialog(f, cp));
                    }
            }
            finally
            {
                File.Delete(tmpLog);
            }
        }
        public Presenter(
            ILogSourcesManager logSourcesManager,
            IChangeNotification changeNotification,
            IView view,
            Preprocessing.IManager sourcesPreprocessingManager,
            Preprocessing.IStepsFactory preprocessingStepsFactory,
            MRU.IRecentlyUsedEntities mru,
            QuickSearchTextBox.IPresenter searchBoxPresenter,
            IAlertPopup alerts,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.view = view;
            this.changeNotification          = changeNotification;
            this.logSourcesManager           = logSourcesManager;
            this.sourcesPreprocessingManager = sourcesPreprocessingManager;
            this.preprocessingStepsFactory   = preprocessingStepsFactory;
            this.mru = mru;
            this.searchBoxPresenter = searchBoxPresenter;
            this.trace  = traceSourceFactory.CreateTraceSource("UI", "hist-dlg");
            this.alerts = alerts;

            items            = Selectors.Create(() => visible, () => acceptedFilter, MakeItems);
            actuallySelected = Selectors.Create(() => items().displayItems, () => selected,
                                                (items, selected) => items.SelectMany(i => i.Flatten()).Where(i => selected.Contains(i.key)).ToImmutableList());
            openButtonEnabled = Selectors.Create(actuallySelected, selected => selected.Any(IsOpenable));
            rootViewItem      = Selectors.Create(() => items().displayItems, () => selected, () => expanded, MakeRootItem);

            searchBoxPresenter.OnSearchNow += (s, e) =>
            {
                acceptedFilter = searchBoxPresenter.Text;
                FocusItemsListAndSelectFirstItem();
                changeNotification.Post();
            };
            searchBoxPresenter.OnRealtimeSearch += (s, e) =>
            {
                acceptedFilter = searchBoxPresenter.Text;
                changeNotification.Post();
            };
            searchBoxPresenter.OnCancelled += (s, e) =>
            {
                if (acceptedFilter != "")
                {
                    acceptedFilter = "";
                    searchBoxPresenter.Focus(null);
                }
                else
                {
                    visible = false;
                }
                changeNotification.Post();
            };

            view.SetViewModel(this);
        }
示例#8
0
 public Presenter(
     IView view,
     IFileDialogs fileDialogs,
     IAlertPopup alerts
     )
 {
     this.view        = view;
     this.fileDialogs = fileDialogs;
     this.alerts      = alerts;
     this.view.SetEventsHandler(this);
 }
示例#9
0
 public PresentationObjectsFactory(
     IManager ppm,
     ILogSourcesManager lsm,
     IChangeNotification changeNotification,
     IAlertPopup alerts
     )
 {
     this.ppm    = ppm;
     this.lsm    = lsm;
     this.alerts = alerts;
 }
 public Presenter(
     IView view,
     Help.IPresenter help,
     IAlertPopup alerts
     )
 {
     this.dialog = view;
     this.dialog.SetEventsHandler(this);
     this.help   = help;
     this.alerts = alerts;
 }
示例#11
0
 public TestParsing(
     IAlertPopup alerts,
     ITempFilesManager tempFilesManager,
     ITraceSourceFactory traceSourceFactory,
     IFactory objectsFactory
     )
 {
     this.alerts             = alerts;
     this.tempFilesManager   = tempFilesManager;
     this.traceSourceFactory = traceSourceFactory;
     this.objectsFactory     = objectsFactory;
 }
示例#12
0
 public Presenter(
     IView view,
     IUserDefinedSearches userDefinedSearches,
     FiltersManagerFactory filtersManagerFactory,
     IAlertPopup alerts
     )
 {
     this.view = view;
     this.userDefinedSearches   = userDefinedSearches;
     this.filtersManagerFactory = filtersManagerFactory;
     this.alerts = alerts;
 }
        public Presenter(
            ILogSourcesManager logSourcesManager,
            Workspaces.IWorkspacesManager workspacesManager,
            Preprocessing.IManager preprocessingsManager,
            IAlertPopup alertPopup,
            IClipboardAccess clipboard,
            IView view,
            IChangeNotification changeNotification
            )
        {
            this.logSourcesManager = logSourcesManager;
            this.workspacesManager = workspacesManager;
            this.view = view;
            this.preprocessingsManager = preprocessingsManager;
            this.alertPopup            = alertPopup;
            this.clipboard             = clipboard;
            this.changeNotification    = changeNotification;

            view.SetEventsHandler(this);

            logSourcesManager.OnLogSourceAdded += (sender, args) =>
            {
                UpdateAvaialibility();
            };

            logSourcesManager.OnLogSourceRemoved += (sender, args) =>
            {
                UpdateAvaialibility();
            };

            workspacesManager.CurrentWorkspaceChanged += (sender, args) =>
            {
                UpdateWorkspaceUrlEditBox();
                UpdateWorkspaceEditCotrols();
            };

            workspacesManager.StatusChanged += (sender, args) =>
            {
                UpdateWorkspaceUrlEditBox();
                UpdateDescription();
                UpdateDialogButtons();
                UpdateProgressIndicator();
                UpdateWorkspaceEditCotrols(triggeredByStatusChange: true);
                UpdateIsBusy();
            };

            UpdateAvaialibility();
            UpdateDescription();
            UpdateWorkspaceUrlEditBox();
            UpdateDialogButtons();
            UpdateWorkspaceEditCotrols();
        }
        public static void Init(
            Dialog.IPresenter optionsDialogPresenter,
            Plugins.IPageAvailability pluginsPageAvailability,
            Persistence.IStorageManager storageManager,
            MainForm.IPresenter mainFormPresenter,
            IAlertPopup popup
            )
        {
            async void handler(object s, EventArgs e)
            {
                mainFormPresenter.Loaded -= handler;
                if (pluginsPageAvailability.IsAvailable)
                {
                    bool showOffer    = false;
                    var  storageEntry = storageManager.GetEntry("PluginsInstallationOffer");
                    using (var section = storageEntry.OpenXMLSection("state", Persistence.StorageSectionOpenFlag.ReadWrite))
                    {
                        if (section.Data.Root == null)
                        {
                            showOffer = true;
                            section.Data.Add(new XElement("root"));
                        }
                    }
                    if (showOffer)
                    {
                        await Task.Delay(1000);

                        string pluginsLocation = "LogJoint options dialog";
                        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                        {
                            pluginsLocation = "menu LogJoint -> Preferences... -> Plug-ins";
                        }
                        else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                        {
                            pluginsLocation = "Options... -> Configuration... -> Plug-ins";
                        }
                        if (popup.ShowPopup(
                                "Plug-ins",
                                "LogJoint offers features via plug-ins. Do you want to choose plug-ins now?" + Environment.NewLine + Environment.NewLine +
                                "You can manage plug-ins any time in " + Environment.NewLine +
                                pluginsLocation,
                                AlertFlags.YesNoCancel
                                ) == AlertFlags.Yes)
                        {
                            optionsDialogPresenter.ShowDialog(Dialog.PageId.Plugins);
                        }
                    }
                }
            }

            mainFormPresenter.Loaded += handler;
        }
示例#15
0
 public PresentationObjectsFactory(
     IManagerInternal ppm,
     ILogSourcesManager lsm,
     IChangeNotification changeNotification,
     IAlertPopup alerts,
     ICorrelationManager correlationManager
     )
 {
     this.ppm                = ppm;
     this.lsm                = lsm;
     this.alerts             = alerts;
     this.correlationManager = correlationManager;
 }
示例#16
0
 public Presenter(
     IView view,
     IWizardScenarioHost host,
     IAlertPopup alerts,
     IFileDialogs fileDialogs
     )
 {
     this.view = view;
     this.view.SetEventsHandler(this);
     this.host        = host;
     this.alerts      = alerts;
     this.fileDialogs = fileDialogs;
 }
示例#17
0
 public static PresentationObjects Create(
     ModelObjects model,
     IClipboardAccess clipboardAccess,
     IShellOpen shellOpen,
     IAlertPopup alertPopup,
     IFileDialogs fileDialogs,
     IPromptDialog promptDialog,
     About.IAboutConfig aboutConfig,
     MainForm.IDragDropHandler dragDropHandler,
     ISystemThemeDetector systemThemeDetector,
     IViewsFactory views
     )
 {
     T callOptionalFactory <T>(Func <T> factory) where T : class
        public Presenter(
            IView view,
            IWizardScenarioHost host,
            IUserDefinedFormatsManager udf,
            IAlertPopup alerts
            )
        {
            this.view = view;
            this.view.SetEventsHandler(this);
            this.host   = host;
            this.udf    = udf;
            this.alerts = alerts;

            LoadFormatsList();
        }
 public Presenter(
     IView view,
     IAlertPopup alerts,
     IFileDialogs fileDialogs,
     FieldsProcessor.IFactory fieldsProcessorFactory,
     Help.IPresenter help
     )
 {
     this.dialog                 = view;
     this.alerts                 = alerts;
     this.fileDialogs            = fileDialogs;
     this.fieldsProcessorFactory = fieldsProcessorFactory;
     this.help = help;
     this.dialog.SetEventsHandler(this);
 }
 public Presenter(
     ICCEView view,
     Help.IPresenter help,
     IAlertPopup alerts,
     ITestParsing testParsing
     )
 {
     this.dialog = view;
     this.dialog.SetEventsHandler(this);
     this.help        = help;
     this.alerts      = alerts;
     this.testParsing = testParsing;
     this.dialog.InitStaticControls(
         "XSLT editor", "XSL transformation code that normalizes your XML log messages", "Help");
 }
示例#21
0
 public Presenter(
     IView view,
     IAlertPopup alerts,
     IFileDialogs fileDialogs,
     ITempFilesManager tempFilesManager,
     Help.IPresenter help
     )
 {
     this.dialog           = view;
     this.alerts           = alerts;
     this.fileDialogs      = fileDialogs;
     this.tempFilesManager = tempFilesManager;
     this.help             = help;
     this.dialog.SetEventsHandler(this);
 }
示例#22
0
 public TestParsing(
     IAlertPopup alerts,
     ITempFilesManager tempFilesManager,
     ITraceSourceFactory traceSourceFactory,
     RegularExpressions.IRegexFactory regexFactory,
     FieldsProcessor.IFactory fieldsProcessorFactory,
     IFactory objectsFactory
     )
 {
     this.alerts                 = alerts;
     this.tempFilesManager       = tempFilesManager;
     this.traceSourceFactory     = traceSourceFactory;
     this.regexFactory           = regexFactory;
     this.objectsFactory         = objectsFactory;
     this.fieldsProcessorFactory = fieldsProcessorFactory;
 }
 public Presenter(
     IView view,
     IWizardScenarioHost host,
     IAlertPopup alerts,
     ILogProviderFactoryRegistry registry,
     bool newFormatMode
     )
 {
     this.view = view;
     this.view.SetEventsHandler(this);
     this.host          = host;
     this.alerts        = alerts;
     this.newFormatMode = newFormatMode;
     this.registry      = registry;
     this.view[ControlId.HeaderLabel] = newFormatMode ? "New format properties:" : "Format properties";
 }
示例#24
0
        public Presenter(
            IView view,
            IFileBasedLogProviderFactory factory,
            ILogSourcesManager model,
            IAlertPopup alerts,
            IFileDialogs fileDialogs
            )
        {
            this.view        = view;
            this.factory     = factory;
            this.model       = model;
            this.alerts      = alerts;
            this.fileDialogs = fileDialogs;

            view.SetEventsHandler(this);
        }
示例#25
0
 public Presenter(
     ILogSourcesManager logSources,
     IShutdown shutdown,
     Progress.IProgressAggregatorFactory progressFactory,
     IAlertPopup alerts,
     IFileDialogs fileDialogs,
     StatusReports.IPresenter statusReport
     )
 {
     this.logSources      = logSources;
     this.shutdown        = shutdown;
     this.progressFactory = progressFactory;
     this.alerts          = alerts;
     this.fileDialogs     = fileDialogs;
     this.statusReport    = statusReport;
 }
 public Presenter(
     IView view,
     IWizardScenarioHost host,
     IAlertPopup alerts,
     IFormatDefinitionsRepository repo,
     bool newFormatMode
     )
 {
     this.view = view;
     this.view.SetEventsHandler(this);
     this.host          = host;
     this.alerts        = alerts;
     this.newFormatMode = newFormatMode;
     this.repo          = repo;
     UpdateView();
 }
        public Presenter(
            IView view,
            ILogSourcesManager logSources,
            Preprocessing.IManager preprocessings,
            IModelThreads threads,
            IPresentersFacade navHandler,
            IAlertPopup alerts,
            IClipboardAccess clipboard,
            IShellOpen shellOpen,
            IColorTheme theme,
            IHeartBeatTimer heartBeat,
            IChangeNotification changeNotification
            )
        {
            this.view               = view;
            this.presentersFacade   = navHandler;
            this.alerts             = alerts;
            this.preprocessings     = preprocessings;
            this.clipboard          = clipboard;
            this.shellOpen          = shellOpen;
            this.theme              = theme;
            this.changeNotification = changeNotification.CreateChainedChangeNotification(initiallyActive: false);

            logSources.OnLogSourceStatsChanged += (s, e) =>
            {
                if (s == logSources)
                {
                    pendingUpdateFlag.Invalidate();
                }
            };

            threads.OnThreadListChanged       += (s, e) => pendingUpdateFlag.Invalidate();
            threads.OnThreadPropertiesChanged += (s, e) => pendingUpdateFlag.Invalidate();

            heartBeat.OnTimer += (s, e) =>
            {
                if (pendingUpdateFlag.Validate())
                {
                    ++forceUpdateRevision;
                    changeNotification.Post();
                }
            };

            this.getViewState = () => emptyViewState;

            view.SetViewModel(this);
        }
 public Presenter(
     ICCEView view,
     Help.IPresenter help,
     IAlertPopup alerts,
     ITestParsing testParsing,
     IFactory objectFactory
     )
 {
     this.dialog = view;
     this.dialog.SetEventsHandler(this);
     this.help           = help;
     this.alerts         = alerts;
     this.objectsFactory = objectFactory;
     this.testParsing    = testParsing;
     this.dialog.InitStaticControls(
         "JUST editor", "JUST transformation code that normalizes your JSON log messages", "Help");
 }
示例#29
0
 public Presenter(
     IView view,
     Help.IPresenter help,
     IAlertPopup alerts,
     ITempFilesManager tempFilesManager,
     IObjectFactory objectFactory
     )
 {
     this.dialog = view;
     this.dialog.SetEventsHandler(this);
     this.help             = help;
     this.alerts           = alerts;
     this.objectsFactory   = objectFactory;
     this.tempFilesManager = tempFilesManager;
     this.dialog.InitStaticControls(
         "XSL transformation code that normalizes your XML log messages", "Help");
 }
 public Presenter(
     IView view,
     IWizardScenarioHost host,
     Help.IPresenter help,
     ITempFilesManager tempFilesManager,
     IAlertPopup alerts,
     IObjectFactory objectsFactory
     )
 {
     this.view = view;
     this.view.SetEventsHandler(this);
     this.host             = host;
     this.help             = help;
     this.tempFilesManager = tempFilesManager;
     this.alerts           = alerts;
     this.objectsFactory   = objectsFactory;
 }