Esempio n. 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);
                }
            };
        }
Esempio n. 2
0
        public PythonDebugReplEvaluator(IServiceProvider serviceProvider) {
            _serviceProvider = serviceProvider;
            _pyService = serviceProvider.GetPythonToolsService();
            AD7Engine.EngineAttached += new EventHandler<AD7EngineEventArgs>(OnEngineAttached);
            AD7Engine.EngineDetaching += new EventHandler<AD7EngineEventArgs>(OnEngineDetaching);

            var dte = _serviceProvider.GetDTE();
            if (dte != null) {
                // running outside of VS, make this work for tests.
                _debuggerEvents = dte.Events.DebuggerEvents;
                _debuggerEvents.OnEnterBreakMode += new EnvDTE._dispDebuggerEvents_OnEnterBreakModeEventHandler(OnEnterBreakMode);
            }
        }
Esempio n. 3
0
        public PythonDebugReplEvaluator(IServiceProvider serviceProvider)
        {
            _serviceProvider           = serviceProvider;
            _pyService                 = serviceProvider.GetPythonToolsService();
            AD7Engine.EngineAttached  += new EventHandler <AD7EngineEventArgs>(OnEngineAttached);
            AD7Engine.EngineDetaching += new EventHandler <AD7EngineEventArgs>(OnEngineDetaching);

            var dte = _serviceProvider.GetDTE();

            if (dte != null)
            {
                // running outside of VS, make this work for tests.
                _debuggerEvents = dte.Events.DebuggerEvents;
                _debuggerEvents.OnEnterBreakMode += new EnvDTE._dispDebuggerEvents_OnEnterBreakModeEventHandler(OnEnterBreakMode);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MonitorToolWindow"/> class.
        /// </summary>
        public MonitorToolWindow() : base(null)
        {
            this.Caption = "NetRx.Store Monitor";

            _monitorToolViewModel = new MonitorToolViewModel();

            ThreadHelper.ThrowIfNotOnUIThread();

            _debuggerEvents = MonitorToolWindowCommand.Instance.Ide.Events.DebuggerEvents;
            _debuggerEvents.OnEnterDesignMode += OnExitDebuggerMode;

            _debugPaneListener = new DebugPaneListener(
                MonitorToolWindowCommand.Instance.Ide.Events.OutputWindowEvents,
                new OutputPaneParser())
            {
                HandleUpdate = message => _monitorToolViewModel.AddStateRecord(message)
            };

            this.Content = new MonitorToolWindowControl(_monitorToolViewModel);
        }
Esempio n. 5
0
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        void InitializePackage()
        {
            debuggerEvents = Utils.GetDTE().Events.DebuggerEvents;
            debuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode;

            Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));

            // Add our command handlers for menu (commands must exist in the .vsct file)
            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (null != mcs)
            {
                // Create the command for the tool window
                CommandID   toolwndCommandID = new CommandID(GuidList.guidCSScriptCmdSet, (int)PkgCmdIDList.cmdidMyTool);
                MenuCommand menuToolWin      = new MenuCommand(ShowToolWindow, toolwndCommandID);
                mcs.AddCommand(menuToolWin);

                // Create the command for the menu item.
                CommandID   menuCommandID = new CommandID(GuidList.guidCSScriptCmdSet, (int)PkgCmdIDList.cmdidMyCommand);
                MenuCommand menuItem      = new MenuCommand(MenuItemCallback, menuCommandID);
                mcs.AddCommand(menuItem);
            }
        }
Esempio n. 6
0
 public JDebugReplEvaluator()
 {
     AD7Engine.EngineAttached += new EventHandler<AD7EngineEventArgs>(OnEngineAttached);
     AD7Engine.EngineDetaching += new EventHandler<AD7EngineEventArgs>(OnEngineDetaching);
     AD7Engine.EngineBreakpointHit += new EventHandler<AD7EngineEventArgs>(OnEngineBreakpointHit);
     if (JToolsPackage.Instance != null) {
         // running outside of VS, make this work for tests.
         _debuggerEvents = JToolsPackage.Instance.DTE.Events.DebuggerEvents;
         _debuggerEvents.OnEnterBreakMode += new EnvDTE._dispDebuggerEvents_OnEnterBreakModeEventHandler(OnEnterBreakMode);
     }
 }