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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15 - (hide annotations) (download)
Tue Apr 3 21:39:47 2012 UTC (8 years, 7 months ago) by william
File size: 1100 byte(s)
add more logging in ConfigLoader

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

  ViewVC Help
Powered by ViewVC 1.1.22