aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs55
1 files changed, 54 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
index 8f521c85a..3a1e85373 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
using System.Threading;
@@ -24,13 +25,23 @@ namespace Tango.PPC.Updater
/// </summary>
public partial class MainWindow : Window
{
+ [DllImport("user32.dll")]
+ private static extern int GetSystemMetrics(int nIndex);
+
private String _sourceFolder = AppDomain.CurrentDomain.BaseDirectory;
private String _msProcessName = "Tango.PPC.UI";
private String _appPath;
private bool EMULATE_EXCEPTION = false;
+ private bool _isEureka;
public MainWindow()
{
+
+
+#if Eureka
+ _isEureka = true;
+#endif
+
//Launch debugger..
#if DEBUG
if (!Debugger.IsAttached)
@@ -44,7 +55,7 @@ namespace Tango.PPC.Updater
WindowStyle = WindowStyle.None;
ResizeMode = ResizeMode.NoResize;
WindowStartupLocation = WindowStartupLocation.Manual;
- Topmost = true; // sure?
+ Topmost = !_isEureka; // sure?
var screens = System.Windows.Forms.Screen.AllScreens;
@@ -64,6 +75,34 @@ namespace Tango.PPC.Updater
Left = 0;
}
+ if (_isEureka)
+ {
+ bool hasTouch = IsTouchEnabled();
+
+ if (!hasTouch)
+ {
+ WindowStyle = WindowStyle.SingleBorderWindow;
+ ResizeMode = ResizeMode.CanResize;
+ Width = 1280;
+ Height = 720;
+ WindowStartupLocation = WindowStartupLocation.CenterScreen;
+ WindowState = WindowState.Normal;
+ Topmost = false; // sure?
+ }
+ else
+ {
+ WindowState = WindowState.Normal;
+ WindowStyle = WindowStyle.None;
+ ResizeMode = ResizeMode.NoResize;
+ Left = screens.Length == 2 ? screens[0].Bounds.Width : 0;
+ Top = 0;
+ Width = 1920;
+ Height = 1080;
+ WindowStartupLocation = WindowStartupLocation.Manual;
+ Topmost = false; // sure?
+ }
+ }
+
ContentRendered += MainWindow_ContentRendered;
btnRetry.Click += BtnRetry_Click;
@@ -344,5 +383,19 @@ namespace Tango.PPC.Updater
{
Update();
}
+
+ /// <summary>
+ /// Determines whether the current machine is touch enabled.
+ /// </summary>
+ public static bool IsTouchEnabled()
+ {
+ foreach (TabletDevice tabletDevice in Tablet.TabletDevices)
+ {
+ if (tabletDevice.Type == TabletDeviceType.Touch && !String.IsNullOrWhiteSpace(tabletDevice.Name))
+ return true;
+ }
+
+ return false;
+ }
}
}