예제 #1
0
        public void populateDefaultVSComObjects()
        {
            VisualStudio_2010.Package           = this;
            VisualStudio_2010.ErrorListProvider = new ErrorListProvider(this);
            VisualStudio_2010.IVsUIShell        = this.getService <IVsUIShell>();
            VisualStudio_2010.DTE2 = this.getService <EnvDTE.DTE, EnvDTE80.DTE2>();
            VisualStudio_2010.OleMenuCommandService = this.getService <OleMenuCommandService>();

            Events = VisualStudio_2010.DTE2.Events;

            BuildEvents         = Events.BuildEvents;
            CommandEvents       = Events.CommandEvents;
            DebuggerEvents      = Events.DebuggerEvents;
            DocumentEvents      = Events.DocumentEvents;
            DTEEvents           = Events.DTEEvents;
            FindEvents          = Events.FindEvents;
            MiscFilesEvents     = Events.MiscFilesEvents;
            OutputWindowEvents  = Events.OutputWindowEvents;
            SelectionEvents     = Events.SelectionEvents;
            SolutionEvents      = Events.SolutionEvents;
            SolutionItemsEvents = Events.SolutionItemsEvents;
            TaskListEvents      = Events.TaskListEvents;
            TextEditorEvents    = Events.TextEditorEvents;
            WindowEvents        = Events.WindowEvents;



            BuildEvents.OnBuildBegin += (scope, action) => VisualStudio_2010.On_BuildBegin.invoke();
            BuildEvents.OnBuildDone  += (scope, action) => VisualStudio_2010.On_BuildDone.invoke();

            BuildEvents.OnBuildProjConfigDone +=
                (Project, ProjectConfig, Platform, SolutionConfig, Success) =>
            {
                //@"On OnBuildProjConfigDone: project: {0} , ProjectConfig: {1} , Platform: {2},  SolutionConfig: {3} , Success: {4}".debug(Project,ProjectConfig, Platform, SolutionConfig,Success);
                if (Success)
                {
                    VisualStudio_2010.On_ProjectBuild_OK.invoke(Project);
                }
                else
                {
                    VisualStudio_2010.On_ProjectBuild_Failed.invoke(Project);
                }
            };

            SolutionEvents.Opened += () => VisualStudio_2010.On_SolutionOpened.invoke();

            DocumentEvents.DocumentOpened  += (document) => VisualStudio_2010.on_DocumentOpened.invoke(document);
            DocumentEvents.DocumentClosing += (document) => VisualStudio_2010.on_DocumentClosing.invoke(document);
            DocumentEvents.DocumentSaved   += (document) => VisualStudio_2010.on_DocumentSaved.invoke(document);
            DocumentEvents.DocumentOpening += (documentPath, readOnly) => VisualStudio_2010.on_DocumentOpening.invoke(documentPath, readOnly);
            TextEditorEvents.LineChanged   += (startPoint, endPoint, hInt) => VisualStudio_2010.on_LineChanged.invoke(startPoint, endPoint);

            WindowEvents.WindowActivated += (windowGotFocus, windowLostFocus) => {
                if (windowGotFocus.Document.notNull())
                {
                    VisualStudio_2010.on_ActiveDocumentChange.invoke(windowGotFocus.Document);
                }
            };
        }
예제 #2
0
        private void AsmViewerControl_Loaded(object sender, RoutedEventArgs e)
        {
            // Configure save event
            dteEvents           = serviceProvider.GetDTE().Events;
            dteDocEvents        = dteEvents.DocumentEvents;
            dteTextEditorEvents = dteEvents.TextEditorEvents;
            dteSelectionEvents  = dteEvents.SelectionEvents;

            dteDocEvents.DocumentSaved += DocumentEvents_DocumentSaved;
        }