示例#1
0
        public UnityRefreshTracker(Lifetime lifetime, ISolution solution, UnityRefresher refresher,
                                   UnityEditorProtocol protocolController, DocumentTransactionManager documentTransactionManager, IShellLocks locks,
                                   ILogger logger)
        {
            myLogger = logger;

            if (solution.GetData(ProjectModelExtensions.ProtocolSolutionKey) == null)
            {
                return;
            }

            var groupingEvent = solution.Locks.GroupingEvents.CreateEvent(lifetime, "UnityRefresherOnSaveEvent", TimeSpan.FromMilliseconds(500),
                                                                          Rgc.Invariant, () => refresher.Refresh(false));

            var protocolSolution = solution.GetProtocolSolution();

            protocolSolution.Editors.AfterDocumentInEditorSaved.Advise(lifetime, _ =>
            {
                if (protocolController.UnityModel.Value == null)
                {
                    return;
                }

                myLogger.Verbose("protocolSolution.Editors.AfterDocumentInEditorSaved");
                groupingEvent.FireIncoming();
            });
        }
        public PreviewTabEditorManager(Lifetime lifetime, ProjectModelSynchronizer projectModelSynchronizer,
                                   IVsUIShellOpenDocument vsUiShellOpenDocument,
                                   VsDocumentManagerSynchronization vsDocumentManagerSynchronization,
                                   ITextControlManager textControlManager, IFrameFocusHelper frameFocusHelper,
                                   DocumentManager documentManager,
                                   DocumentTransactionManager documentTransactionManager,
                                   IThreading threading)
            : base(lifetime, projectModelSynchronizer, vsUiShellOpenDocument, vsDocumentManagerSynchronization,
             textControlManager, frameFocusHelper, documentManager)
        {
            this.documentTransactionManager = documentTransactionManager;
              this.threading = threading;

              previewTabRequests = 0;
        }