Skip to content

Commit

Permalink
Change Screen public signature to be identical with the Windows Forms…
Browse files Browse the repository at this point in the history
… ones
  • Loading branch information
micdenny committed Sep 12, 2014
1 parent 8b02f34 commit 33a3857
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Source/WpfScreenHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
[assembly: Guid("e75f4c20-72a3-4e02-9b94-a0c4e6e9c127")]

// WpfScreenHelper version number: <major>.<minor>.<non-breaking-feature>.<build>
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyVersion("0.3.0.0")]

// Note: until version 1.0 expect breaking changes on 0.X versions.

// 0.3.0.0 Modified Screen public signature to be identical with the Windows Forms ones (http://referencesource.microsoft.com/#System.Windows.Forms/ndp/fx/src/winforms/Managed/System/WinForms/Screen.cs)
// 0.2.0.0 Changed target framework to 4.0 to be compatible with old software
// 0.1.0.0 Initial
14 changes: 7 additions & 7 deletions Source/WpfScreenHelper/Screen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ private Screen(IntPtr monitor, IntPtr hdc)
if (!multiMonitorSupport || monitor == (IntPtr)PRIMARY_MONITOR)
{
this.Bounds = SystemInformation.VirtualScreen;
this.IsPrimary = true;
this.Name = "DISPLAY";
this.Primary = true;
this.DeviceName = "DISPLAY";
}
else
{
Expand All @@ -58,9 +58,9 @@ private Screen(IntPtr monitor, IntPtr hdc)
info.rcMonitor.right - info.rcMonitor.left,
info.rcMonitor.bottom - info.rcMonitor.top);

this.IsPrimary = ((info.dwFlags & MONITORINFOF_PRIMARY) != 0);
this.Primary = ((info.dwFlags & MONITORINFOF_PRIMARY) != 0);

this.Name = new string(info.szDevice).TrimEnd((char)0);
this.DeviceName = new string(info.szDevice).TrimEnd((char)0);
}
hmonitor = monitor;
}
Expand Down Expand Up @@ -97,13 +97,13 @@ public static IEnumerable<Screen> AllScreens
/// Gets the device name associated with a display.
/// </summary>
/// <returns>The device name associated with a display.</returns>
public string Name { get; private set; }
public string DeviceName { get; private set; }

/// <summary>
/// Gets a value indicating whether a particular display is the primary device.
/// </summary>
/// <returns>true if this display is primary; otherwise, false.</returns>
public bool IsPrimary { get; private set; }
public bool Primary { get; private set; }

/// <summary>
/// Gets the primary display.
Expand All @@ -115,7 +115,7 @@ public static Screen PrimaryScreen
{
if (multiMonitorSupport)
{
return AllScreens.FirstOrDefault(t => t.IsPrimary);
return AllScreens.FirstOrDefault(t => t.Primary);
}
return new Screen((IntPtr)PRIMARY_MONITOR);
}
Expand Down

0 comments on commit 33a3857

Please sign in to comment.