From cef6e99e7454861365debee704f2c61c8b4ece8c Mon Sep 17 00:00:00 2001 From: Daniel Clark Date: Sat, 13 Feb 2021 17:18:45 +0000 Subject: [PATCH] clean up wpf.ui some more --- .../NativeMethods.json | 4 --- .../Extensions/ImageSourceExtensions.cs | 30 ------------------- .../Extensions/VisualExtensions.cs | 13 -------- .../NativeMethods.json | 4 --- .../NotificationFlyout.Wpf.UI.csproj | 8 ----- 5 files changed, 59 deletions(-) delete mode 100644 src/NotificationFlyout.Shared.UI/NativeMethods.json delete mode 100644 src/NotificationFlyout.Wpf.UI/Extensions/ImageSourceExtensions.cs delete mode 100644 src/NotificationFlyout.Wpf.UI/NativeMethods.json diff --git a/src/NotificationFlyout.Shared.UI/NativeMethods.json b/src/NotificationFlyout.Shared.UI/NativeMethods.json deleted file mode 100644 index 29dbe6e..0000000 --- a/src/NotificationFlyout.Shared.UI/NativeMethods.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "D:\\git\\CsWin32\\src\\Microsoft.Windows.CsWin32\\settings.schema.json", - "emitSingleFile": true -} \ No newline at end of file diff --git a/src/NotificationFlyout.Wpf.UI/Extensions/ImageSourceExtensions.cs b/src/NotificationFlyout.Wpf.UI/Extensions/ImageSourceExtensions.cs deleted file mode 100644 index d068b04..0000000 --- a/src/NotificationFlyout.Wpf.UI/Extensions/ImageSourceExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Drawing; -using System.Windows; -using System.Windows.Media; - -namespace NotificationFlyout.Wpf.UI.Extensions -{ - public static class ImageSourceExtensions - { - //public static Icon ConvertToIcon(this ImageSource imageSource, uint dpi) - //{ - // if (imageSource == null) return null; - - // var uri = new Uri(imageSource.ToString(), UriKind.RelativeOrAbsolute); - - // var streamResource = Application.GetResourceStream(uri); - // if (streamResource == null) throw new ArgumentException(nameof(streamResource)); - - // return new Icon(streamResource.Stream, new System.Drawing.Size(PInvoke.GetSystemMetricsForDpi((int)SystemMetricFlag.SM_CXICON, dpi), PInvoke.GetSystemMetricsForDpi((int)SystemMetricFlag.SM_CYICON, dpi))); - //} - - private enum SystemMetricFlag : int - { - SM_CXICON = 11, - SM_CYICON = 12, - SM_CXSMICON = 49, - SM_CYSMICON = 50 - } - } -} \ No newline at end of file diff --git a/src/NotificationFlyout.Wpf.UI/Extensions/VisualExtensions.cs b/src/NotificationFlyout.Wpf.UI/Extensions/VisualExtensions.cs index 79331c2..95b3410 100644 --- a/src/NotificationFlyout.Wpf.UI/Extensions/VisualExtensions.cs +++ b/src/NotificationFlyout.Wpf.UI/Extensions/VisualExtensions.cs @@ -22,18 +22,5 @@ namespace NotificationFlyout.Wpf.UI.Extensions { return GetDpi(visual).M11; } - - public static bool TryGetTransformToDevice(this Visual visual, out Matrix value) - { - var presentationSource = PresentationSource.FromVisual(visual); - if (presentationSource != null) - { - value = presentationSource.CompositionTarget.TransformToDevice; - return true; - } - - value = default; - return false; - } } } \ No newline at end of file diff --git a/src/NotificationFlyout.Wpf.UI/NativeMethods.json b/src/NotificationFlyout.Wpf.UI/NativeMethods.json deleted file mode 100644 index 29dbe6e..0000000 --- a/src/NotificationFlyout.Wpf.UI/NativeMethods.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "D:\\git\\CsWin32\\src\\Microsoft.Windows.CsWin32\\settings.schema.json", - "emitSingleFile": true -} \ No newline at end of file diff --git a/src/NotificationFlyout.Wpf.UI/NotificationFlyout.Wpf.UI.csproj b/src/NotificationFlyout.Wpf.UI/NotificationFlyout.Wpf.UI.csproj index dcfa2a5..b8a08a8 100644 --- a/src/NotificationFlyout.Wpf.UI/NotificationFlyout.Wpf.UI.csproj +++ b/src/NotificationFlyout.Wpf.UI/NotificationFlyout.Wpf.UI.csproj @@ -11,14 +11,6 @@ 1.0.0 - - - - - - - -