public DocumentEventArgs(VsShell.IVsRunningDocumentTable rdt, uint docCookie)
        {
            if (rdt == null)
            {
                throw new ArgumentNullException("rdt");
            }
            if (docCookie <= 0)
            {
                throw new ArgumentOutOfRangeException("docCookie");
            }

            m_rdt       = rdt;
            m_docCookie = docCookie;
        }
Beispiel #2
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!");
            }
        }
Beispiel #3
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!");
            }
        }