コード例 #1
0
        public PostprocessorsInitializer(
            IPostprocessorsManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager,
            StateInspector.IPostprocessorsFactory stateInspectorPostprocessorsFactory,
            TimeSeries.IPostprocessorsFactory timeSeriesPostprocessorsFactory
            )
        {
            Func <string, UDF> findFormat = formatName =>
            {
                var ret = userDefinedFormatsManager.Items.FirstOrDefault(
                    f => f.CompanyName == "Google" && f.FormatName == formatName) as UDF;
                if (ret == null)
                {
                    throw new Exception(string.Format("Log format {0} is not registered in LogJoint", formatName));
                }
                return(ret);
            };

            this.chromeDebugLogFormat      = findFormat("Chrome debug log");
            this.webRtcInternalsDumpFormat = findFormat("Chrome WebRTC internals dump as log");

            this.chromeDebugLogMeta = new LogSourceMetadata(
                chromeDebugLogFormat,
                stateInspectorPostprocessorsFactory.CreateChromeDebugPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateChromeDebugPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.chromeDebugLogMeta);

            this.webRtcInternalsDumpMeta = new LogSourceMetadata(
                webRtcInternalsDumpFormat,
                stateInspectorPostprocessorsFactory.CreateWebRtcInternalsDumpPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateWebRtcInternalsDumpPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.webRtcInternalsDumpMeta);
        }
コード例 #2
0
        static void InitLogFactories(LJTraceSource tracer, IUserDefinedFormatsManager userDefinedFormatsManager, ILogProviderFactoryRegistry factoryRegistry)
        {
            using (tracer.NewFrame)
            {
                var asmsToAnalize = new Assembly[] {
                    Assembly.GetEntryAssembly(),
                    typeof(ILogSourcesManager).Assembly
                };
                var factoryTypes = asmsToAnalize.SelectMany(a => a.GetTypes())
                                   .Where(t => t.IsClass && typeof(ILogProviderFactory).IsAssignableFrom(t));

                foreach (Type t in factoryTypes)
                {
                    tracer.Info("initing factory {0}", t.FullName);
                    System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(t.TypeHandle);
                    var registrationMethod = (
                        from m in t.GetMethods(BindingFlags.Static | BindingFlags.Public)
                        where m.GetCustomAttributes(typeof(RegistrationMethodAttribute), true).Length == 1
                        let args = m.GetParameters()
                                   where args.Length == 1
                                   let isUserDefined = typeof(IUserDefinedFormatsManager) == args[0].ParameterType
                                                       let isBuiltin = typeof(ILogProviderFactoryRegistry) == args[0].ParameterType
                                                                       where isUserDefined || isBuiltin
                                                                       select new { Method = m, Arg = isUserDefined ? (object)userDefinedFormatsManager : (object)factoryRegistry }
                        ).FirstOrDefault();
                    if (registrationMethod != null)
                    {
                        t.InvokeMember(registrationMethod.Method.Name,
                                       BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static,
                                       null, null, new object[] { registrationMethod.Arg });
                    }
                }
            }
        }
コード例 #3
0
        public static void Register(
            IManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager,
            ITimeSeriesTypesAccess timeSeriesTypesAccess,
            IModel postprocessingModel)
        {
            var fac = userDefinedFormatsManager.Items.FirstOrDefault(f => f.FormatName == "LogJoint debug trace") as UDF;

            if (fac == null)
            {
                return;
            }
            var timeline = new LogSourcePostprocessor(
                PostprocessorKind.Timeline,
                input => RunTimelinePostprocessor(input, postprocessingModel)
                );
            var timeSeries = new LogSourcePostprocessor(
                PostprocessorKind.TimeSeries,
                input => RunTimeSeriesPostprocessor(input, postprocessingModel)
                );

            timeSeriesTypesAccess.RegisterTimeSeriesTypesAssembly(typeof(LJT.ProfilingSeries).Assembly);
            postprocessorsManager.RegisterLogType(new LogSourceMetadata(fac, new[]
            {
                timeline,
                timeSeries
            }));
        }
コード例 #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 PostprocessorsInitializer(
            IManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager,
            Timeline.IPostprocessorsFactory timelinePostprocessorsFactory
            )
        {
            IUserDefinedFactory findFormat(string company, string formatName)
            {
                var ret = userDefinedFormatsManager.Items.FirstOrDefault(
                    f => f.CompanyName == company && f.FormatName == formatName);

                if (ret == null)
                {
                    throw new Exception(string.Format("Log format {0} is not registered in LogJoint", formatName));
                }
                return(ret);
            }

            this.wiresharkPdmlFormat = findFormat("Wireshark", "pdml");

            this.wiresharkPdml = new LogSourceMetadata(
                wiresharkPdmlFormat,
                timelinePostprocessorsFactory.CreateWiresharkDpmlPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.wiresharkPdml);
        }
コード例 #6
0
        public PostprocessorsInitializer(
            IPostprocessorsManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager,
            StateInspector.IPostprocessorsFactory stateInspectorPostprocessorsFactory,
            TimeSeries.IPostprocessorsFactory timeSeriesPostprocessorsFactory,
            Correlator.IPostprocessorsFactory correlatorPostprocessorsFactory,
            Timeline.IPostprocessorsFactory timelinePostprocessorsFactory
            )
        {
            Func <string, string, UDF> findFormat = (company, formatName) =>
            {
                var ret = userDefinedFormatsManager.Items.FirstOrDefault(
                    f => f.CompanyName == company && f.FormatName == formatName) as UDF;
                if (ret == null)
                {
                    throw new Exception(string.Format("Log format {0} is not registered in LogJoint", formatName));
                }
                return(ret);
            };

            this.chromeDebugLogFormat      = findFormat("Google", "Chrome debug log");
            this.webRtcInternalsDumpFormat = findFormat("Google", "Chrome WebRTC internals dump as log");
            this.chromeDriverLogFormat     = findFormat("Google", "chromedriver");
            this.symRtcLogFormat           = findFormat("Symphony", "RTC log");

            var correlatorPostprocessorType = correlatorPostprocessorsFactory.CreatePostprocessor(this);

            postprocessorsManager.RegisterCrossLogSourcePostprocessor(correlatorPostprocessorType);

            this.chromeDebugLogMeta = new LogSourceMetadata(
                chromeDebugLogFormat,
                stateInspectorPostprocessorsFactory.CreateChromeDebugPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateChromeDebugPostprocessor(),
                timelinePostprocessorsFactory.CreateChromeDebugPostprocessor(),
                correlatorPostprocessorType
                );
            postprocessorsManager.RegisterLogType(this.chromeDebugLogMeta);

            this.webRtcInternalsDumpMeta = new LogSourceMetadata(
                webRtcInternalsDumpFormat,
                stateInspectorPostprocessorsFactory.CreateWebRtcInternalsDumpPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateWebRtcInternalsDumpPostprocessor(),
                correlatorPostprocessorType
                );
            postprocessorsManager.RegisterLogType(this.webRtcInternalsDumpMeta);

            this.chromeDriverLogMeta = new LogSourceMetadata(
                chromeDriverLogFormat,
                timelinePostprocessorsFactory.CreateChromeDriverPostprocessor(),
                correlatorPostprocessorType
                );
            postprocessorsManager.RegisterLogType(this.chromeDriverLogMeta);

            this.symRtcLogMeta = new LogSourceMetadata(
                symRtcLogFormat,
                stateInspectorPostprocessorsFactory.CreateSymphontRtcPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.symRtcLogMeta);
        }
コード例 #7
0
        public PostprocessorsInitializer(
            IManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager,
            StateInspector.IPostprocessorsFactory stateInspectorPostprocessorsFactory,
            TimeSeries.IPostprocessorsFactory timeSeriesPostprocessorsFactory,
            Correlator.IPostprocessorsFactory correlatorPostprocessorsFactory,
            Timeline.IPostprocessorsFactory timelinePostprocessorsFactory,
            SequenceDiagram.IPostprocessorsFactory sequenceDiagramPostprocessorsFactory
            )
        {
            IUserDefinedFactory findFormat(string company, string formatName)
            {
                var ret = userDefinedFormatsManager.Items.FirstOrDefault(
                    f => f.CompanyName == company && f.FormatName == formatName);

                if (ret == null)
                {
                    throw new Exception(string.Format("Log format {0} is not registered in LogJoint", formatName));
                }
                return(ret);
            }

            this.chromeDebugLogFormat      = findFormat("Google", "Chrome debug log");
            this.webRtcInternalsDumpFormat = findFormat("Google", "Chrome WebRTC internals dump as log");
            this.chromeDriverLogFormat     = findFormat("Google", "chromedriver");
            this.httpArchiveFormat         = findFormat("W3C", "HTTP Archive (HAR)");

            this.chromeDebugLogMeta = new LogSourceMetadata(
                chromeDebugLogFormat,
                stateInspectorPostprocessorsFactory.CreateChromeDebugPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateChromeDebugPostprocessor(),
                timelinePostprocessorsFactory.CreateChromeDebugPostprocessor(),
                sequenceDiagramPostprocessorsFactory.CreateChromeDebugPostprocessor(),
                correlatorPostprocessorsFactory.CreateChromeDebugPostprocessor()
                );
            postprocessorsManager.Register(this.chromeDebugLogMeta);

            this.webRtcInternalsDumpMeta = new LogSourceMetadata(
                webRtcInternalsDumpFormat,
                stateInspectorPostprocessorsFactory.CreateWebRtcInternalsDumpPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateWebRtcInternalsDumpPostprocessor(),
                correlatorPostprocessorsFactory.CreateWebRtcInternalsPostprocessor()
                );
            postprocessorsManager.Register(this.webRtcInternalsDumpMeta);

            this.chromeDriverLogMeta = new LogSourceMetadata(
                chromeDriverLogFormat,
                timelinePostprocessorsFactory.CreateChromeDriverPostprocessor(),
                correlatorPostprocessorsFactory.CreateChromeDriverPostprocessor()
                );
            postprocessorsManager.Register(this.chromeDriverLogMeta);

            this.httpArchiveMeta = new LogSourceMetadata(
                httpArchiveFormat,
                timelinePostprocessorsFactory.CreateHttpArchivePostprocessor(),
                sequenceDiagramPostprocessorsFactory.CreateHttpArchivePostprocessor()
                );
            postprocessorsManager.Register(this.httpArchiveMeta);
        }
コード例 #8
0
ファイル: Model.cs プロジェクト: pnelson786/logjoint
 public Model(
     IInvokeSynchronization threadSync,
     Telemetry.ITelemetryCollector telemetryCollector,
     Persistence.IWebContentCache webCache,
     Persistence.IContentCache contentCache,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     ILogSourcesManager sourcesManager,
     IModelThreads threads,
     ITempFilesManager tempFilesManager,
     Preprocessing.IPreprocessingManagerExtensionsRegistry preprocessingManagerExtentionsRegistry,
     Preprocessing.ILogSourcesPreprocessingManager logSourcesPreprocessingManager,
     Preprocessing.IPreprocessingStepsFactory preprocessingStepsFactory,
     Progress.IProgressAggregator progressAggregator,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     MRU.IRecentlyUsedEntities mru,
     Progress.IProgressAggregatorFactory progressAggregatorsFactory,
     IHeartBeatTimer heartbeat,
     ILogSourcesController logSourcesController,
     IShutdown shutdown,
     WebBrowserDownloader.IDownloader webBrowserDownloader,
     AppLaunch.ICommandLineHandler commandLineHandler,
     Postprocessing.IPostprocessorsManager postprocessorsManager,
     Postprocessing.IUserNamesProvider analyticsShortNames,
     Analytics.TimeSeries.ITimeSeriesTypesAccess timeSeriesTypes,
     Postprocessing.IAggregatingLogSourceNamesProvider logSourceNamesProvider
     )
 {
     this.ModelThreadSynchronization = threadSync;
     this.Telemetry        = telemetryCollector;
     this.WebContentCache  = webCache;
     this.ContentCache     = contentCache;
     this.StorageManager   = storageManager;
     this.Bookmarks        = bookmarks;
     this.SourcesManager   = sourcesManager;
     this.Threads          = threads;
     this.TempFilesManager = tempFilesManager;
     this.PreprocessingManagerExtensionsRegistry = preprocessingManagerExtentionsRegistry;
     this.PreprocessingStepsFactory      = preprocessingStepsFactory;
     this.LogSourcesPreprocessingManager = logSourcesPreprocessingManager;
     this.ProgressAggregator             = progressAggregator;
     this.LogProviderFactoryRegistry     = logProviderFactoryRegistry;
     this.UserDefinedFormatsManager      = userDefinedFormatsManager;
     this.ProgressAggregatorsFactory     = progressAggregatorsFactory;
     this.MRU                    = mru;
     this.Heartbeat              = heartbeat;
     this.LogSourcesController   = logSourcesController;
     this.Shutdown               = shutdown;
     this.WebBrowserDownloader   = webBrowserDownloader;
     this.CommandLineHandler     = commandLineHandler;
     this.PostprocessorsManager  = postprocessorsManager;
     this.ShortNames             = analyticsShortNames;
     this.TimeSeriesTypes        = timeSeriesTypes;
     this.LogSourceNamesProvider = logSourceNamesProvider;
 }
コード例 #9
0
ファイル: AppInitializer.cs プロジェクト: pnelson786/logjoint
 public AppInitializer(
     LJTraceSource tracer,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     ILogProviderFactoryRegistry factoryRegistry,
     ITempFilesManager tempFiles)
 {
     InitializePlatform(tracer);
     InitLogFactories(userDefinedFormatsManager, factoryRegistry, tempFiles);
     userDefinedFormatsManager.ReloadFactories();
 }
コード例 #10
0
ファイル: AppInitializer.cs プロジェクト: pnelson786/logjoint
 static void InitLogFactories(
     IUserDefinedFormatsManager userDefinedFormatsManager,
     ILogProviderFactoryRegistry factoryRegistry,
     ITempFilesManager tempFiles)
 {
     RegularGrammar.UserDefinedFormatFactory.Register(userDefinedFormatsManager);
     XmlFormat.UserDefinedFormatFactory.Register(userDefinedFormatsManager);
     JsonFormat.UserDefinedFormatFactory.Register(userDefinedFormatsManager);
     factoryRegistry.Register(new PlainText.Factory(tempFiles));
     factoryRegistry.Register(new XmlFormat.NativeXMLFormatFactory(tempFiles));
 }
コード例 #11
0
        public PostprocessorsInitializer(
            IManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager,
            StateInspector.IPostprocessorsFactory stateInspectorPostprocessorsFactory,
            TimeSeries.IPostprocessorsFactory timeSeriesPostprocessorsFactory,
            Correlator.IPostprocessorsFactory correlatorPostprocessorsFactory,
            Timeline.IPostprocessorsFactory timelinePostprocessorsFactory,
            SequenceDiagram.IPostprocessorsFactory sequenceDiagramPostprocessorsFactory
            )
        {
            IUserDefinedFactory findFormat(string company, string formatName)
            {
                var ret = userDefinedFormatsManager.Items.FirstOrDefault(
                    f => f.CompanyName == company && f.FormatName == formatName);

                if (ret == null)
                {
                    throw new Exception(string.Format("Log format {0} is not registered in LogJoint", formatName));
                }
                return(ret);
            }

            this.symRtcLogFormat        = findFormat("Symphony", "RTC log");
            this.springServiceLogFormat = findFormat("Symphony", "RTC Java Spring Service log");
            this.smbLogFormat           = findFormat("Symphony", "SMB log");

            var correlatorPostprocessorType = correlatorPostprocessorsFactory.CreatePostprocessor(this);

            postprocessorsManager.RegisterCrossLogSourcePostprocessor(correlatorPostprocessorType);

            this.springServiceLogMeta = new LogSourceMetadata(
                springServiceLogFormat,
                sequenceDiagramPostprocessorsFactory.CreateSpringServiceLogPostprocessor(),
                timelinePostprocessorsFactory.CreateSpringServiceLogPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.springServiceLogMeta);

            this.symRtcLogMeta = new LogSourceMetadata(
                symRtcLogFormat,
                stateInspectorPostprocessorsFactory.CreateSymphonyRtcPostprocessor(),
                timeSeriesPostprocessorsFactory.CreateSymphonyRtcPostprocessor(),
                timelinePostprocessorsFactory.CreateSymRtcPostprocessor(),
                sequenceDiagramPostprocessorsFactory.CreateRtcLogPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.symRtcLogMeta);

            this.smbLogMeta = new LogSourceMetadata(
                smbLogFormat,
                sequenceDiagramPostprocessorsFactory.CreateSMBPostprocessor()
                );
            postprocessorsManager.RegisterLogType(this.smbLogMeta);
        }
コード例 #12
0
        private static void RegisterPredefinedFormatFactories(
            ILogProviderFactoryRegistry logProviderFactoryRegistry,
            ITempFilesManager tempFilesManager,
            IUserDefinedFormatsManager userDefinedFormatsManager)
        {
#if WIN
            logProviderFactoryRegistry.Register(new DebugOutput.Factory());
            logProviderFactoryRegistry.Register(new WindowsEventLog.Factory());
#endif
            logProviderFactoryRegistry.Register(new PlainText.Factory(tempFilesManager));
            logProviderFactoryRegistry.Register(new XmlFormat.NativeXMLFormatFactory(tempFilesManager));
            userDefinedFormatsManager.ReloadFactories();
        }
コード例 #13
0
        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();
        }
コード例 #14
0
ファイル: Factory.cs プロジェクト: sabrogden/logjoint
 private static void RegisterPredefinedFormatFactories(
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     ITempFilesManager tempFilesManager,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     RegularExpressions.IRegexFactory regexFactory,
     ITraceSourceFactory traceSourceFactory)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         RegisterWindowsOnlyFactories(logProviderFactoryRegistry);
     }
     logProviderFactoryRegistry.Register(new PlainText.Factory(tempFilesManager));
     logProviderFactoryRegistry.Register(new XmlFormat.NativeXMLFormatFactory(tempFilesManager, regexFactory, traceSourceFactory));
     userDefinedFormatsManager.ReloadFactories();
 }
コード例 #15
0
ファイル: Model.cs プロジェクト: rkapl123/logjoint
 public Model(
     ISynchronizationContext threadSync,
     IChangeNotification changeNotification,
     Persistence.IWebContentCache webCache,
     Persistence.IContentCache contentCache,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     ILogSourcesManager sourcesManager,
     IModelThreads threads,
     ITempFilesManager tempFilesManager,
     Preprocessing.IModel preprocessingModel,
     Progress.IProgressAggregator progressAggregator,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     MRU.IRecentlyUsedEntities mru,
     Progress.IProgressAggregatorFactory progressAggregatorsFactory,
     IShutdown shutdown,
     WebViewTools.IWebViewTools webViewTools,
     Postprocessing.IModel postprocessingModel,
     IPluginsManager pluginsManager,
     ITraceSourceFactory traceSourceFactory,
     LogMedia.IFileSystem fileSystem
     )
 {
     this.SynchronizationContext = threadSync;
     this.ChangeNotification     = changeNotification;
     this.WebContentCache        = webCache;
     this.ContentCache           = contentCache;
     this.StorageManager         = storageManager;
     this.Bookmarks                  = bookmarks;
     this.SourcesManager             = sourcesManager;
     this.Threads                    = threads;
     this.TempFilesManager           = tempFilesManager;
     this.Preprocessing              = preprocessingModel;
     this.ProgressAggregator         = progressAggregator;
     this.LogProviderFactoryRegistry = logProviderFactoryRegistry;
     this.UserDefinedFormatsManager  = userDefinedFormatsManager;
     this.ProgressAggregatorsFactory = progressAggregatorsFactory;
     this.MRU                = mru;
     this.Shutdown           = shutdown;
     this.WebViewTools       = webViewTools;
     this.Postprocessing     = postprocessingModel;
     this.PluginsManager     = pluginsManager;
     this.TraceSourceFactory = traceSourceFactory;
     this.FileSystem         = fileSystem;
 }
コード例 #16
0
 public Presenter(
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     IPagePresentersRegistry registry,
     IRecentlyUsedEntities mru,
     IView view,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     Func <IPagePresenter> formatDetectionPageFactory,
     FormatsWizard.IPresenter formatsWizardPresenter
     )
 {
     this.logProviderFactoryRegistry = logProviderFactoryRegistry;
     this.registry = registry;
     this.mru      = mru;
     this.view     = view;
     this.formatDetectionPageFactory = formatDetectionPageFactory;
     this.userDefinedFormatsManager  = userDefinedFormatsManager;
     this.formatsWizardPresenter     = formatsWizardPresenter;
 }
コード例 #17
0
ファイル: ObjectsFactory.cs プロジェクト: pnelson786/logjoint
 public ObjectsFactory(
     IAlertPopup alerts,
     IFileDialogs fileDialogs,
     Help.IPresenter help,
     ILogProviderFactoryRegistry registry,
     IFormatDefinitionsRepository repo,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     ITempFilesManager tempFilesManager,
     LogViewer.IPresenterFactory logViewerPresenterFactory,
     ViewFactories viewFactories
     )
 {
     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;
 }
コード例 #18
0
        public static void Register(
            IPostprocessorsManager postprocessorsManager,
            IUserDefinedFormatsManager userDefinedFormatsManager
            )
        {
            var fac = userDefinedFormatsManager.Items.FirstOrDefault(f => f.FormatName == "LogJoint debug trace") as UDF;

            if (fac == null)
            {
                return;
            }
            var timeline = new LogSourcePostprocessorImpl(
                PostprocessorIds.Timeline, "Timeline",                 // todo: avoid copy/pasing of the strings
                (doc, logSource) => DeserializeOutput(doc, logSource),
                (Func <LogSourcePostprocessorInput, Task>)RunTimelinePostprocessor
                );

            postprocessorsManager.RegisterLogType(new LogSourceMetadata(fac, new []
            {
                timeline
            }));
        }
コード例 #19
0
ファイル: XmlLogReader.cs プロジェクト: pnelson786/logjoint
 public static void Register(IUserDefinedFormatsManager formatsManager)
 {
     formatsManager.RegisterFormatType(
         "xml", typeof(UserDefinedFormatFactory));
 }
コード例 #20
0
        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();
        }
コード例 #21
0
ファイル: Factory.cs プロジェクト: sabrogden/logjoint
 private static void RegisterUserDefinedFormats(IUserDefinedFormatsManager userDefinedFormatsManager)
 {
     RegularGrammar.UserDefinedFormatFactory.Register(userDefinedFormatsManager);
     XmlFormat.UserDefinedFormatFactory.Register(userDefinedFormatsManager);
     JsonFormat.UserDefinedFormatFactory.Register(userDefinedFormatsManager);
 }
コード例 #22
0
ファイル: RegularLogReader.cs プロジェクト: rkapl123/logjoint
 public static void Register(IUserDefinedFormatsManager formatsManager)
 {
     formatsManager.RegisterFormatType(
         "regular-grammar", typeof(UserDefinedFormatFactory));
 }
コード例 #23
0
        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);
        }