Ejemplo n.º 1
0
        public Presenter(
            IView view,
            ITempFilesManager tempFilesManager,
            ITraceSourceFactory traceSourceFactory,
            RegularExpressions.IRegexFactory regexFactory,
            LogViewer.IPresenterFactory logViewerPresenterFactory,
            ISynchronizationContext synchronizationContext,
            LogMedia.IFileSystem fileSystem
            )
        {
            this.view = view;
            this.view.SetEventsHandler(this);
            this.tempFilesManager       = tempFilesManager;
            this.traceSourceFactory     = traceSourceFactory;
            this.regexFactory           = regexFactory;
            this.synchronizationContext = synchronizationContext;
            this.fileSystem             = fileSystem;

            this.threads          = new ModelThreads();
            this.logSourceThreads = new LogSourceThreads(
                LJTraceSource.EmptyTracer, threads, null);
            this.model            = new Presenters.LogViewer.DummyModel();
            this.logPresenter     = logViewerPresenterFactory.CreateIsolatedPresenter(model, view.LogViewer);
            logPresenter.ShowTime = true;
            logPresenter.EmptyViewMessageAllowed = false;
        }
Ejemplo n.º 2
0
 public LogSourcesManager(
     IHeartBeatTimer heartbeat,
     ISynchronizationContext invoker,
     IModelThreadsInternal threads,
     ITempFilesManager tempFilesManager,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     MRU.IRecentlyUsedEntities recentlyUsedEntities,
     IShutdown shutdown,
     ITraceSourceFactory traceSourceFactory,
     IChangeNotification changeNotification
     ) : this(heartbeat, recentlyUsedEntities, shutdown, traceSourceFactory, changeNotification,
              new LogSourceFactory(threads, bookmarks, invoker, storageManager, tempFilesManager, globalSettingsAccess, traceSourceFactory))
 {
 }
Ejemplo n.º 3
0
 public LogSourceFactory(
     IModelThreadsInternal threads,
     IBookmarks bookmarks,
     ISynchronizationContext invoker,
     Persistence.IStorageManager storageManager,
     ITempFilesManager tempFilesManager,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.threads              = threads;
     this.bookmarks            = bookmarks;
     this.invoker              = invoker;
     this.storageManager       = storageManager;
     this.tempFilesManager     = tempFilesManager;
     this.globalSettingsAccess = globalSettingsAccess;
     this.traceSourceFactory   = traceSourceFactory;
 }
Ejemplo n.º 4
0
        public Presenter(
            IView view,
            ITempFilesManager tempFilesManager,
            ITraceSourceFactory traceSourceFactory,
            LogViewer.IPresenterFactory logViewerPresenterFactory,
            ISynchronizationContext synchronizationContext
            )
        {
            this.view = view;
            this.view.SetEventsHandler(this);
            this.tempFilesManager       = tempFilesManager;
            this.traceSourceFactory     = traceSourceFactory;
            this.synchronizationContext = synchronizationContext;

            this.threads          = new ModelThreads();
            this.logSourceThreads = new LogSourceThreads(
                LJTraceSource.EmptyTracer, threads, null);
            this.model            = new Presenters.LogViewer.DummyModel();
            this.logPresenter     = logViewerPresenterFactory.CreateIsolatedPresenter(model, view.LogViewer);
            logPresenter.ShowTime = true;
        }
Ejemplo n.º 5
0
 public LogSourceFactory(
     IModelThreadsInternal threads,
     IBookmarks bookmarks,
     ISynchronizationContext invoker,
     Persistence.IStorageManager storageManager,
     ITempFilesManager tempFilesManager,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     ITraceSourceFactory traceSourceFactory,
     RegularExpressions.IRegexFactory regexFactory,
     LogMedia.IFileSystem fileSystem
     )
 {
     this.threads              = threads;
     this.bookmarks            = bookmarks;
     this.invoker              = invoker;
     this.storageManager       = storageManager;
     this.tempFilesManager     = tempFilesManager;
     this.globalSettingsAccess = globalSettingsAccess;
     this.traceSourceFactory   = traceSourceFactory;
     this.regexFactory         = regexFactory;
     this.fileSystem           = fileSystem;
 }
Ejemplo n.º 6
0
        public LogSource(ILogSourcesManagerInternal owner, int id,
                         ILogProviderFactory providerFactory, IConnectionParams connectionParams,
                         IModelThreadsInternal threads, ITempFilesManager tempFilesManager, Persistence.IStorageManager storageManager,
                         ISynchronizationContext modelSyncContext, Settings.IGlobalSettingsAccessor globalSettingsAccess, IBookmarks bookmarks,
                         ITraceSourceFactory traceSourceFactory, RegularExpressions.IRegexFactory regexFactory, LogMedia.IFileSystem fileSystem)
        {
            this.owner                = owner;
            this.tracer               = traceSourceFactory.CreateTraceSource("LogSource", string.Format("ls{0:D2}", id));
            this.tempFilesManager     = tempFilesManager;
            this.modelSyncContext     = modelSyncContext;
            this.globalSettingsAccess = globalSettingsAccess;
            this.bookmarks            = bookmarks;
            this.traceSourceFactory   = traceSourceFactory;
            this.regexFactory         = regexFactory;
            this.fileSystem           = fileSystem;

            try
            {
                this.logSourceThreads              = new LogSourceThreads(this.tracer, threads, this);
                this.timeGaps                      = new TimeGapsDetector(tracer, modelSyncContext, new LogSourceGapsSource(this), traceSourceFactory);
                this.timeGaps.OnTimeGapsChanged   += timeGaps_OnTimeGapsChanged;
                this.logSourceSpecificStorageEntry = CreateLogSourceSpecificStorageEntry(providerFactory, connectionParams, storageManager);

                var extendedConnectionParams = connectionParams.Clone(true);
                this.LoadPersistedSettings(extendedConnectionParams);
                this.provider = providerFactory.CreateFromConnectionParams(this, extendedConnectionParams);
            }
            catch (Exception e)
            {
                tracer.Error(e, "Failed to initialize log source");
                ((ILogSource)this).Dispose();
                throw;
            }

            this.owner.Add(this);
            this.owner.FireOnLogSourceAdded(this);

            this.LoadBookmarks();
        }
Ejemplo n.º 7
0
 public LogSourceThreads(LJTraceSource tracer, IModelThreadsInternal modelThreads, ILogSource threadsSource)
 {
     this.tracer       = tracer;
     this.modelThreads = modelThreads;
     this.logSource    = threadsSource;
 }