Example #1
0
        public int OnBeforeCloseSolution(object pUnkReserved)
        {
            if (m_saveListener != null)
            {
                this.service.push();
                m_saveListener.shutdown();
                m_saveListener = null;
            }

            return(VSConstants.S_OK);
        }
Example #2
0
        private void InitializeWithDTEAndSolutionReady()
        {
            m_dte = (EnvDTE.DTE) this.GetService(typeof(EnvDTE.DTE));

            if (m_dte == null)
            {
                ErrorHandler.ThrowOnFailure(1);
            }

            var solutionBase = "";
            var solutionName = "";

            if (m_dte.Solution != null)
            {
                solutionBase = System.IO.Path.GetDirectoryName(m_dte.Solution.FullName);
                solutionName = System.IO.Path.GetFileNameWithoutExtension(m_dte.Solution.FullName);
            }
            //string dbName = string.Format("Ganji.History-{0}.sdf", solutionName);

            var basePath     = PreparePath();
            var ganjiContext = new GanjiContext();

            ganjiContext.RepositoryPath = System.IO.Path.Combine(basePath, "LocalHistory");
            ganjiContext.SolutionPath   = solutionBase;

            CodeElementMagic.m_applicationObject = m_dte;

            HistoryContext.ConfigureDatabase(basePath);
            RemindersContext.ConfigureDatabase(basePath);
            SessionsContext.ConfigureDatabase(basePath);

            m_saveListener = new SaveListener();
            m_saveListener.Register(m_dte, ganjiContext);

            m_navigateListener = new NavigateListener();
            m_navigateListener.Register(m_dte, ganjiContext);

            m_exceptionListener = new ExceptionListener();
            m_exceptionListener.Register(m_dte, ganjiContext);
            //if (m_version != null)
            //{
            //    dbName = string.Format("ActivityDB{0}-{1}.sdf", m_version.ToString(),solutionName);
            //}

            //var basePath = PreparePath();
            //var path = System.IO.Path.Combine(basePath, dbName);
            //database = new Database(path);
            //database.OpenOrCreate();
        }
Example #3
0
        private void InitializeWithDTEAndSolutionReady()
        {
            m_dte = (EnvDTE.DTE) this.GetService(typeof(EnvDTE.DTE));

            if (m_dte == null)
            {
                ErrorHandler.ThrowOnFailure(1);
            }

            var solution_path = "";

            if (m_dte.Solution != null)
            {
                solution_path = System.IO.Path.GetDirectoryName(m_dte.Solution.FullName);
                this.service  = new AutopushService((OptionPageGrid)GetDialogPage(typeof(OptionPageGrid)),
                                                    (IVsUIShell)GetService(typeof(SVsUIShell)), solution_path);
                m_saveListener = new SaveListener();
                m_saveListener.register(m_dte, service);
            }
        }