Esempio n. 1
0
        public void RegisterDocumentListener()
        {
            var documentTable = (IVsRunningDocumentTable)GetGlobalService(typeof(SVsRunningDocumentTable));

            Debug.WriteLine(dte.Solution.FullName);

            // Create a new document repository for the solution
            var solutionDirectory   = Path.GetDirectoryName(dte.Solution.FullName);
            var repositoryDirectory = Path.Combine(solutionDirectory, ".localhistory");

            documentRepository = new DocumentRepository(solutionDirectory, repositoryDirectory);

            // Create and register a document listener that will handle save events
            documentListener = new LocalHistoryDocumentListener(documentTable, documentRepository);

            documentTable.AdviseRunningDocTableEvents(documentListener, out rdtCookie);
        }
        public void RegisterDocumentListener()
        {
            IVsRunningDocumentTable documentTable = (IVsRunningDocumentTable)Package.GetGlobalService(typeof(SVsRunningDocumentTable));

              Debug.WriteLine(dte.Solution.FullName);

              // Create a new document repository for the solution
              string solutionDirectory = System.IO.Path.GetDirectoryName(dte.Solution.FullName);
              string repositoryDirectory = System.IO.Path.Combine(solutionDirectory, ".localhistory");
              documentRepository = new DocumentRepository(solutionDirectory, repositoryDirectory);

              // Create and register a document listener that will handle save events
              documentListener = new LocalHistoryDocumentListener(documentTable, documentRepository);

              documentTable.AdviseRunningDocTableEvents(documentListener, out rdtCookie);
        }