From 09d217a5e257c515e6aa9be514e3cd93e88af2f5 Mon Sep 17 00:00:00 2001 From: reduckted Date: Thu, 16 Feb 2023 20:48:34 +1000 Subject: [PATCH 1/4] FrameShow is not flagged. --- .../Windows/WindowFrame.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs index df0af42..649557f 100644 --- a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs +++ b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs @@ -1,4 +1,4 @@ -// ================================================================================================ +// ================================================================================================ // WindowFrame.cs // // Created: 2008.07.02, by Istvan Novak (DeepDiver) @@ -440,7 +440,6 @@ public enum FramePosition /// /// Specifies options when the show state of a window frame changes. /// - [Flags] public enum FrameShow { /// Reason unknown From a6ae3f79d76cfd24c3846f19c41f341c1c14d6c4 Mon Sep 17 00:00:00 2001 From: reduckted Date: Thu, 16 Feb 2023 20:51:19 +1000 Subject: [PATCH 2/4] Removed duplicate and obsolete enum values from FrameShow. --- .../Windows/WindowFrame.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs index 649557f..804692a 100644 --- a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs +++ b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs @@ -442,12 +442,8 @@ public enum FramePosition /// public enum FrameShow { - /// Reason unknown - Unknown = 0, - /// Obsolete; use WinHidden. - Hidden = __FRAMESHOW.FRAMESHOW_Hidden, /// Window (tabbed or otherwise) is hidden. - WinHidden = __FRAMESHOW.FRAMESHOW_WinHidden, + Hidden = __FRAMESHOW.FRAMESHOW_WinHidden, /// A nontabbed window is made visible. Shown = __FRAMESHOW.FRAMESHOW_WinShown, /// A tabbed window is activated (made visible). From b8b3d10d4bcb55e7345e3597589a6029aa38b097 Mon Sep 17 00:00:00 2001 From: reduckted Date: Thu, 16 Feb 2023 20:52:03 +1000 Subject: [PATCH 3/4] Added comments explaining what the equivalent __SHOWFRAME enum value is. --- .../Windows/WindowFrame.cs | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs index 804692a..9ea41c8 100644 --- a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs +++ b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs @@ -232,7 +232,7 @@ public async Task IsOnScreenAsync() public async Task GetDocumentViewAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); - + // Force the loading of a document that may be pending initialization. // See https://docs.microsoft.com/en-us/visualstudio/extensibility/internals/delayed-document-loading _frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out _); @@ -442,23 +442,50 @@ public enum FramePosition /// public enum FrameShow { - /// Window (tabbed or otherwise) is hidden. + /// + /// Window (tabbed or otherwise) is hidden. + /// Equivalent to . + /// Hidden = __FRAMESHOW.FRAMESHOW_WinHidden, - /// A nontabbed window is made visible. + /// + /// A non-tabbed window is made visible. + /// Equivalent to . + /// Shown = __FRAMESHOW.FRAMESHOW_WinShown, - /// A tabbed window is activated (made visible). + /// + /// A tabbed window is activated (made visible). + /// Equivalent to . + /// TabActivated = __FRAMESHOW.FRAMESHOW_TabActivated, - /// A tabbed window is deactivated. + /// + /// A tabbed window is deactivated. + /// Equivalent to . + /// TabDeactivated = __FRAMESHOW.FRAMESHOW_TabDeactivated, - /// Window is restored to normal state. + /// + /// Window is restored to normal state. + /// Equivalent to . + /// Restored = __FRAMESHOW.FRAMESHOW_WinRestored, - /// Window is minimized. + /// + /// Window is minimized. + /// Equivalent to . + /// Minimized = __FRAMESHOW.FRAMESHOW_WinMinimized, - /// Window is maximized. + /// + /// Window is maximized. + /// Equivalent to . + /// Maximized = __FRAMESHOW.FRAMESHOW_WinMaximized, - /// Multi-instance tool window destroyed. + /// + /// Multi-instance tool window destroyed. + /// Equivalent to . + /// DestroyMultipleInstance = __FRAMESHOW.FRAMESHOW_DestroyMultInst, - /// Autohidden window is about to slide into view. + /// + /// Auto-hidden window is about to slide into view. + /// Equivalent to . + /// AutoHideSlideBegin = __FRAMESHOW.FRAMESHOW_AutoHideSlideBegin } From 4e04081ff8ff84b8a545ec8b5e19c9aad8f15dc2 Mon Sep 17 00:00:00 2001 From: reduckted Date: Thu, 16 Feb 2023 21:03:56 +1000 Subject: [PATCH 4/4] Extended FrameShow enum to include values from __FRAMESHOW2, __FRAMESHOW3 and __FRAMESHOW4. --- .../Windows/WindowFrame.cs | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs index 9ea41c8..3cc5b18 100644 --- a/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs +++ b/src/toolkit/Community.VisualStudio.Toolkit.Shared/Windows/WindowFrame.cs @@ -1,4 +1,4 @@ -// ================================================================================================ +// ================================================================================================ // WindowFrame.cs // // Created: 2008.07.02, by Istvan Novak (DeepDiver) @@ -440,6 +440,13 @@ public enum FramePosition /// /// Specifies options when the show state of a window frame changes. /// + /// + /// This combines the values from + /// , + /// , + /// and + /// . + /// public enum FrameShow { /// @@ -486,7 +493,32 @@ public enum FrameShow /// Auto-hidden window is about to slide into view. /// Equivalent to . /// - AutoHideSlideBegin = __FRAMESHOW.FRAMESHOW_AutoHideSlideBegin + AutoHideSlideBegin = __FRAMESHOW.FRAMESHOW_AutoHideSlideBegin, + /// + /// A window is about to be hidden. + /// Equivalent to . + /// + BeforeHidden = __FRAMESHOW2.FRAMESHOW_BeforeWinHidden, + /// + /// Auto-hidden window is finished sliding into view. + /// Equivalent to . + /// + AutoHideSlideEnd = __FRAMESHOW2.FRAMESHOW_AutoHideSlideEnd, + /// + /// A window is activated (made visible). + /// Equivalent to . + /// + Activated = __FRAMESHOW3.FRAMESHOW_WinActivated, + /// + /// The window's inner content received keyboard focus. + /// Equivalent to . + /// + ContentGotFocus = __FRAMESHOW4.FRAMESHOW_WinContentGotFocus, + /// + /// The window's inner content lost keyboard focus. + /// Equivalent to . + /// + ContentLostFocus = __FRAMESHOW4.FRAMESHOW_WinContentLostFocus } /// @@ -573,4 +605,16 @@ public WindowFrameDockChangedEventArgs(Rectangle position, bool docked) Docked = docked; } } + + +#if VS14 + /// + /// __FRAMESHOW4 was first defined in Visual Studio 15. + /// + internal enum __FRAMESHOW4 + { + FRAMESHOW_WinContentGotFocus = 13, + FRAMESHOW_WinContentLostFocus + } +#endif } \ No newline at end of file