From 1e739bb4ff3080a19a7edc71fc2fcb022ac067ea Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Thu, 8 Dec 2011 00:14:36 +0000 Subject: [PATCH] Added minimal SystemEvents definition to allow compilation on mobile devices. --- Source/OpenTK/Minimal.cs | 9 +++++++++ Source/OpenTK/Platform/Windows/WinDisplayDevice.cs | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Minimal.cs b/Source/OpenTK/Minimal.cs index a3751c51..8c13934f 100644 --- a/Source/OpenTK/Minimal.cs +++ b/Source/OpenTK/Minimal.cs @@ -2173,6 +2173,15 @@ namespace OpenTK } #endregion + + #region SystemEvents + + sealed class SystemEvents + { + public static event EventHandler DisplaySettingsChanged; + } + + #endregion } // Need a different namespace to avoid clash with OpenTK.Graphics. diff --git a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs index 195c119b..511f8fb6 100644 --- a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs +++ b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs @@ -28,6 +28,9 @@ using System; using System.Collections.Generic; using System.Diagnostics; +#if !MINIMAL +using Microsoft.Win32; +#endif namespace OpenTK.Platform.Windows { @@ -40,7 +43,7 @@ namespace OpenTK.Platform.Windows public WinDisplayDeviceDriver() { RefreshDisplayDevices(); - Microsoft.Win32.SystemEvents.DisplaySettingsChanged += + SystemEvents.DisplaySettingsChanged += HandleDisplaySettingsChanged; } @@ -173,7 +176,7 @@ namespace OpenTK.Platform.Windows ~WinDisplayDeviceDriver() { - Microsoft.Win32.SystemEvents.DisplaySettingsChanged -= + SystemEvents.DisplaySettingsChanged -= HandleDisplaySettingsChanged; }