/[EmuXPortal]/trunk/EmuXPortal/Api/DisplayHelper.cs
ViewVC logotype

Annotation of /trunk/EmuXPortal/Api/DisplayHelper.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13 - (hide annotations) (download)
Tue Apr 3 21:00:28 2012 UTC (8 years, 6 months ago) by william
File size: 1006 byte(s)
setup config to move form to proper screen at start

1 william 13 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using System.Windows.Forms;
6    
7     namespace EmuXPortal.Api
8     {
9     public class DisplayHelper
10     {
11     public DisplayHelper() : this(Screen.PrimaryScreen) { }
12     public DisplayHelper(string device) : this(GetScreenFromString(device)) { }
13     public DisplayHelper(Screen device)
14     {
15     PhysicalDisplayDevice = device;
16     }
17     #region GetScreenFromString
18     private static Screen GetScreenFromString(string device)
19     {
20     Screen scn = Screen.PrimaryScreen;
21     foreach (Screen screen in Screen.AllScreens) { if (screen.DeviceName.ToLower() == device.ToLower()) { scn = screen; break; } }
22     return scn;
23     }
24     #endregion
25     private Screen _PhysicalDisplayDevice;
26     public Screen PhysicalDisplayDevice { get { return _PhysicalDisplayDevice; } private set { _PhysicalDisplayDevice = value; } }
27     }
28     }

  ViewVC Help
Powered by ViewVC 1.1.22