Ejemplo n.º 1
0
        public Core()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Start Core(): {0}", this.ToString()));

            //SolutionEventsListener class from http://stackoverflow.com/questions/2525457/automating-visual-studio-with-envdte
            // via Elisha http://stackoverflow.com/users/167149/elisha
            SolutionEventsListener = new SolutionEventsListener();

            SolutionEventsListener.OnAfterCloseSolution += () =>
            {
                ToolWindowPane window = this.AccurateReferencesPackage.FindToolWindow(typeof(MyToolWindow), 0, true);
                if (window != null)
                    ((MyControl)window.Content).OnSolutionUnload();
            };

            SolutionEventsListener.OnAfterOpenSolution += () =>
            {
                ToolWindowPane window = this.AccurateReferencesPackage.FindToolWindow(typeof(MyToolWindow), 0, true);
                if (window != null)
                    ((MyControl)window.Content).OnSolutionLoad();
            };

            Dte = Package.GetGlobalService(typeof(DTE)) as EnvDTE80.DTE2;
            Events = Dte.Events as Events2;
        }
Ejemplo n.º 2
0
        public Core()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Start Core(): {0}", this.ToString()));

            //SolutionEventsListener class from http://stackoverflow.com/questions/2525457/automating-visual-studio-with-envdte
            // via Elisha http://stackoverflow.com/users/167149/elisha
            SolutionEventsListener = new SolutionEventsListener();

            Dte = Package.GetGlobalService(typeof(DTE)) as EnvDTE80.DTE2;
            Events = Dte.Events as Events2;
        }