diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-04-26 17:55:17 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-04-26 17:55:17 +0300 |
| commit | 914d28f26fcc61c12f0a98c86e6a5ad5a455f72c (patch) | |
| tree | 49b8f80ff3a6ba8bd7e8159605277593b10e8125 /Software/Visual_Studio/PPC/Tango.PPC.Updater | |
| parent | 07a75244fe05eb4b2b0b628ec8f038cced238579 (diff) | |
| download | Tango-914d28f26fcc61c12f0a98c86e6a5ad5a455f72c.tar.gz Tango-914d28f26fcc61c12f0a98c86e6a5ad5a455f72c.zip | |
More Eureka Adjustments.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Updater')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Updater/MainWindow.xaml.cs | 55 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj | 9 |
2 files changed, 63 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; + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj index 8f8430102..1e3102b0e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj @@ -33,6 +33,15 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Eureka|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>..\..\Build\Eureka\Release\</OutputPath> + <DefineConstants>TRACE;Eureka</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> <PropertyGroup> <ApplicationManifest>app.manifest</ApplicationManifest> </PropertyGroup> |
