mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-17 17:28:53 -05:00
Release 1.0.6
************* CHG Removed version text from NuGet files. CHG Replaced Tuple usage from SystemInfo by Point, which is also supported by .NET 3.5. CHG Changelog and credits update.
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
using System;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||
{
|
||||
public static class SystemInfo
|
||||
{
|
||||
private static Tuple<double, double> dpiFactors;
|
||||
private static System.Windows.Point? dpiFactors;
|
||||
|
||||
private static Tuple<double, double> DpiFactors
|
||||
private static System.Windows.Point? DpiFactors
|
||||
{
|
||||
get
|
||||
{
|
||||
if (dpiFactors == null)
|
||||
using (var source = new HwndSource(new HwndSourceParameters()))
|
||||
dpiFactors = Tuple.Create(source.CompositionTarget.TransformToDevice.M11, source.CompositionTarget.TransformToDevice.M22);
|
||||
dpiFactors = new System.Windows.Point(source.CompositionTarget.TransformToDevice.M11, source.CompositionTarget.TransformToDevice.M22);
|
||||
return dpiFactors;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +22,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||
get
|
||||
{
|
||||
var factors = DpiFactors;
|
||||
return factors != null ? factors.Item1 : 1;
|
||||
return factors.HasValue ? factors.Value.X : 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +31,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||
get
|
||||
{
|
||||
var factors = DpiFactors;
|
||||
return factors != null ? factors.Item2 : 1;
|
||||
return factors.HasValue ? factors.Value.Y : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user