Ejemplo n.º 1
0
        private RdtManager()
        {
            // assert if we're not on the UI thread.  GetService calls must be made on the UI thread, so caching 
            // these services lets this class be used on multiple threads.

            if (Application.MessageLoop == false)
            {
                Debug.Fail("Must create RdtManager on the UI Thread");
                throw new InvalidOperationException("Must create RdtManager on the UI Thread");
            }

            _invisibleEditorManager =
                Package.GetGlobalService(typeof(VsShell.SVsInvisibleEditorManager)) as VsShell.IVsInvisibleEditorManager;
            _runningDocumentTable = Package.GetGlobalService(typeof(VsShell.IVsRunningDocumentTable)) as VsShell.IVsRunningDocumentTable;
            _dte = Package.GetGlobalService(typeof(_DTE)) as _DTE;
            _uiShell = Package.GetGlobalService(typeof(VsShell.SVsUIShell)) as VsShell.IVsUIShell;
            if (_uiShell == null)
            {
                throw new InvalidOperationException("Could not get _uiShell!");
            }
        }