From 4c0d2feeaad53c6de0c2a7dd891ed0bae4405cf0 Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 20 Dec 2017 13:09:23 -0700 Subject: [PATCH] Updated dependencies on DWM changes --- PInvoke/CredUI/Vanara.PInvoke.CredUI.csproj | 1 + WIndows.Forms/Controls/ThemedLabel.cs | 4 ++-- WIndows.Forms/Controls/ThemedPanel.cs | 2 +- WIndows.Forms/Controls/ThemedTableLayoutPanel.cs | 2 +- WIndows.Forms/Extenders/GlassExtenderProvider.cs | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PInvoke/CredUI/Vanara.PInvoke.CredUI.csproj b/PInvoke/CredUI/Vanara.PInvoke.CredUI.csproj index e3130cc4..b48213c5 100644 --- a/PInvoke/CredUI/Vanara.PInvoke.CredUI.csproj +++ b/PInvoke/CredUI/Vanara.PInvoke.CredUI.csproj @@ -50,6 +50,7 @@ CREDUI_INFO + \ No newline at end of file diff --git a/WIndows.Forms/Controls/ThemedLabel.cs b/WIndows.Forms/Controls/ThemedLabel.cs index a9106eb3..97dd3ba5 100644 --- a/WIndows.Forms/Controls/ThemedLabel.cs +++ b/WIndows.Forms/Controls/ThemedLabel.cs @@ -187,7 +187,7 @@ namespace Vanara.Windows.Forms ref tff, out tRect, out iRect); // Draw background - if (SupportGlass && !this.IsDesignMode() && DesktopWindowManager.IsCompositionEnabled()) + if (SupportGlass && !this.IsDesignMode() && DesktopWindowManager.CompositionEnabled) e.Graphics.Clear(Color.Black); else { @@ -220,7 +220,7 @@ namespace Vanara.Windows.Forms } else { - var br = DesktopWindowManager.IsCompositionEnabled() ? SystemBrushes.ActiveCaptionText : SystemBrushes.ControlText; + var br = DesktopWindowManager.CompositionEnabled ? SystemBrushes.ActiveCaptionText : SystemBrushes.ControlText; var sf = new StringFormat(StringFormat.GenericDefault); if (rtl == RightToLeft.Yes) sf.FormatFlags |= StringFormatFlags.DirectionRightToLeft; e.Graphics.DrawString(Text, Font, br, ClientRectangle, sf); diff --git a/WIndows.Forms/Controls/ThemedPanel.cs b/WIndows.Forms/Controls/ThemedPanel.cs index 6614252e..840bee40 100644 --- a/WIndows.Forms/Controls/ThemedPanel.cs +++ b/WIndows.Forms/Controls/ThemedPanel.cs @@ -82,7 +82,7 @@ namespace Vanara.Windows.Forms protected override void OnPaint(PaintEventArgs e) { - if (!this.IsDesignMode() && SupportGlass && DesktopWindowManager.IsCompositionEnabled()) + if (!this.IsDesignMode() && SupportGlass && DesktopWindowManager.CompositionEnabled) try { e.Graphics.Clear(Color.Black); } catch { } else { diff --git a/WIndows.Forms/Controls/ThemedTableLayoutPanel.cs b/WIndows.Forms/Controls/ThemedTableLayoutPanel.cs index de5aad99..efa307a6 100644 --- a/WIndows.Forms/Controls/ThemedTableLayoutPanel.cs +++ b/WIndows.Forms/Controls/ThemedTableLayoutPanel.cs @@ -78,7 +78,7 @@ namespace Vanara.Windows.Forms /// A that contains the event data. protected override void OnPaint(PaintEventArgs e) { - if (!this.IsDesignMode() && SupportGlass && DesktopWindowManager.IsCompositionEnabled()) + if (!this.IsDesignMode() && SupportGlass && DesktopWindowManager.CompositionEnabled) try { e.Graphics.Clear(Color.Black); } catch { } else { diff --git a/WIndows.Forms/Extenders/GlassExtenderProvider.cs b/WIndows.Forms/Extenders/GlassExtenderProvider.cs index af9c3f13..c40967b1 100644 --- a/WIndows.Forms/Extenders/GlassExtenderProvider.cs +++ b/WIndows.Forms/Extenders/GlassExtenderProvider.cs @@ -220,7 +220,7 @@ namespace Vanara.Windows.Forms private void form_Resize(object sender, EventArgs e) { var form = sender as Form; - if ((DesktopWindowManager.IsCompositionEnabled() && GetGlassEnabled(form)) || form.IsDesignMode()) + if ((DesktopWindowManager.CompositionEnabled && GetGlassEnabled(form)) || form.IsDesignMode()) InvalidateNonGlassClientArea(form); } @@ -247,7 +247,7 @@ namespace Vanara.Windows.Forms private void GlassifyForm(Form form, Graphics g = null) { - if (!(DesktopWindowManager.IsCompositionEnabled() && GetGlassEnabled(form)) && !form.IsDesignMode()) + if (!(DesktopWindowManager.CompositionEnabled && GetGlassEnabled(form)) && !form.IsDesignMode()) return; if (g == null) g = form.CreateGraphics();