コード例 #1
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();
        }
コード例 #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();
        }