/// <summary>
        /// Obtains all window frames for DocumentWindows visible in the IDE.
        /// </summary>
        /// <returns>All available window frames for DocumentWindows.</returns>
        public async Task <IEnumerable <WindowFrame> > GetAllDocumentWindowsAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            IVsUIShell uiShell = await VS.Services.GetUIShellAsync();

            ErrorHandler.ThrowOnFailure(uiShell.GetDocumentWindowEnum(out IEnumWindowFrames? docEnum));
            IVsWindowFrame[]   windowFrames = new IVsWindowFrame[1];
            List <WindowFrame>?frames       = new List <WindowFrame>();
            uint fetched = 0;

            while (docEnum.Next(1, windowFrames, out fetched) == VSConstants.S_OK && fetched == 1)
            {
                IVsWindowFrame?windowFrame = windowFrames[0];
                WindowFrame?   frame       = new WindowFrame(windowFrame);
                frames.Add(frame);
            }
            return(frames);
        }
예제 #2
0
 internal ActiveFrameChangeEventArgs(IVsWindowFrame oldFrame, IVsWindowFrame newFrame)
 {
     OldFrame = new WindowFrame(oldFrame);
     NewFrame = new WindowFrame(newFrame);
 }
예제 #3
0
 internal FrameOnScreenEventArgs(IVsWindowFrame frame, bool isOnScreen)
 {
     Frame      = new WindowFrame(frame);
     IsOnScreen = isOnScreen;
 }