Inheritance: IProjectExplorer
Ejemplo 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;
        }
Ejemplo 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;
        }