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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 238 - (hide annotations) (download)
Tue Aug 5 04:50:39 2014 UTC (6 years, 2 months ago) by william
File size: 1104 byte(s)
+ use Enterprise.Logging instead of EmuXPortal.Logging

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 238 using Enterprise.Logging;
7 william 13
8     namespace EmuXPortal.Api
9     {
10     public class DisplayHelper
11     {
12 william 238 public DisplayHelper() : this(Screen.PrimaryScreen) { }
13     public DisplayHelper(string device) : this(GetScreenFromString(device)) { }
14     public DisplayHelper(Screen device)
15 william 13 {
16 william 238 gLog.Debug.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