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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 112 - (hide annotations) (download)
Thu Aug 23 04:13:19 2012 UTC (8 years, 2 months ago) by william
File size: 1140 byte(s)
OPTIMIZE 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 15 using EmuXPortal.Logging;
7 william 13
8     namespace EmuXPortal.Api
9     {
10     public class DisplayHelper
11     {
12 william 112 public DisplayHelper(logger log) : this(log,Screen.PrimaryScreen) { }
13     public DisplayHelper(logger log, string device) : this(log, GetScreenFromString(device)) { }
14     public DisplayHelper(logger log, Screen device)
15 william 13 {
16 william 112 log.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