Exemple #1
0
        public DebugManager(ExcelDnaToolsPackage package, ExcelConnection connection)
        {
            _package    = package;
            _connection = connection;
            var packageServiceProvider = (IServiceProvider)package;

            _debugger = packageServiceProvider.GetService(typeof(SVsShellDebugger)) as IVsDebugger;
            // var dgr = Package.GetGlobalService(typeof(SVsShellDebugger)) ;
            // _debugger = dgr as IVsDebugger;
            _dte = packageServiceProvider.GetService(typeof(SDTE)) as DTE;
            if (_dte != null)
            {
                _dteDebugger = _dte.Debugger as Debugger2;
            }

            if (_package == null || _debugger == null || _dte == null || _dteDebugger == null)
            {
                Debug.Fail("DebugManager setup failed");
                return;
            }

            if (_debugger.AdviseDebuggerEvents(this, out _debuggerEventsCookie) != VSConstants.S_OK)
            {
                Debug.Fail("DebugManager setup failed");
            }

            if (_debugger.AdviseDebugEventCallback(this) != VSConstants.S_OK)
            {
                Debug.Fail("DebugManager setup failed");
            }
        }
        public SolutionHelper(ExcelDnaToolsPackage package)
        {
            _package = package;
            var packageServiceProvider = (IServiceProvider)package;

            _dte = packageServiceProvider.GetService(typeof(DTE)) as DTE;
        }
Exemple #3
0
        public DebugManager(ExcelDnaToolsPackage package, ExcelConnection connection)
        {
            _package = package;
            _connection = connection;
            var packageServiceProvider = (IServiceProvider)package;
             _debugger = packageServiceProvider.GetService(typeof(SVsShellDebugger)) as IVsDebugger;
            // var dgr = Package.GetGlobalService(typeof(SVsShellDebugger)) ;
            // _debugger = dgr as IVsDebugger;
            _dte = packageServiceProvider.GetService(typeof(SDTE)) as DTE;
            if (_dte != null)
            {
                _dteDebugger = _dte.Debugger as Debugger2;
            }

            if (_package == null || _debugger == null || _dte == null || _dteDebugger == null)
            {
                Debug.Fail("DebugManager setup failed");
                return;
            }

            if (_debugger.AdviseDebuggerEvents(this, out _debuggerEventsCookie) != VSConstants.S_OK)
            {
                Debug.Fail("DebugManager setup failed");
            }

            if (_debugger.AdviseDebugEventCallback(this) != VSConstants.S_OK)
            {
                Debug.Fail("DebugManager setup failed");
            }
        }
Exemple #4
0
 public SolutionHelper(ExcelDnaToolsPackage package)
 {
     _package = package;
     var packageServiceProvider = (IServiceProvider)package;
     _dte = packageServiceProvider.GetService(typeof(DTE)) as DTE;
 }