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:
Philipp Sumi
2016-03-21 09:53:34 +01:00
parent 3d29133708
commit 337da82ce2
5 changed files with 20 additions and 17 deletions

View File

@@ -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;
}
}
}