Inheritance: IProjectExplorer
Esempio n. 1
0
        private bool TryGetEnvironmentAndView()
        {
            TextView = AdaptersFactoryService.GetWpfTextView(TextViewAdapter);
            try
            {
                VsEnvironment = (DTE)ServiceProvider.GetService(typeof(DTE));
                if (VsEnvironment != null)
                    ProjectExplorer = new ProjectExplorer(VsEnvironment);
            }
            catch (COMException ex)
            {
                //TODO: Log the COM Exception somewhere
                //Unable to attach to the current visual studio environment
                VsEnvironment = null;
            }

            return TextView != null && VsEnvironment != null;
        }
Esempio n. 2
0
        private IProjectExplorer GetFromVsEnvironment()
        {
            IProjectExplorer projectExplorer = null;
            try
            {
                VsEnvironment = (DTE)ServiceProvider.GetService(typeof(DTE));
                if (VsEnvironment != null)
                    projectExplorer = new ProjectExplorer(VsEnvironment);
            }
            catch (COMException ex)
            {
                //TODO: Log the COM Exception somewhere
                //Unable to attach to the current visual studio environment
                VsEnvironment = null;
            }

            return projectExplorer;
        }