From ae4241e7572470ae44d45c6531497ba15b67b032 Mon Sep 17 00:00:00 2001
From: Brett Hewitson
Date: Tue, 30 Nov 2021 11:54:54 +1000
Subject: [PATCH] Added globalization to the Main Window Start Mode setting in
the Global Settings.
---
.../Globalization/en-US/en-US.xaml | 6 ++++++
src/ARKServerManager/VersionFeed.xml | 1 +
src/ARKServerManager/VersionFeedBeta.xml | 1 +
.../Windows/GlobalSettingsControl.xaml | 2 +-
.../Windows/GlobalSettingsControl.xaml.cs | 14 ++++++++------
5 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml
index b1d5d60b..16869a5b 100644
--- a/src/ARKServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml
@@ -51,6 +51,12 @@
All
+
+ Normal
+ Minimized
+ Maximized
+
+
Run as Administrator
This application requires administration priviledges to access ALL functionality. Would you like to Run as Administrator?
diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml
index 2d11fc16..c21ed38f 100644
--- a/src/ARKServerManager/VersionFeed.xml
+++ b/src/ARKServerManager/VersionFeed.xml
@@ -19,6 +19,7 @@
CHANGE
+ - Added globalization to the Main Window Start Mode setting in the Global Settings.
- zh-CN Translation file updated.
diff --git a/src/ARKServerManager/VersionFeedBeta.xml b/src/ARKServerManager/VersionFeedBeta.xml
index 1480403e..5d8591a6 100644
--- a/src/ARKServerManager/VersionFeedBeta.xml
+++ b/src/ARKServerManager/VersionFeedBeta.xml
@@ -19,6 +19,7 @@
CHANGE
+ - Added globalization to the Main Window Start Mode setting in the Global Settings.
- zh-CN Translation file updated.
diff --git a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
index 0a274c0b..675f64f1 100644
--- a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
+++ b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml
@@ -94,7 +94,7 @@
-
+
diff --git a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
index 0313abb3..451aa454 100644
--- a/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
+++ b/src/ARKServerManager/Windows/GlobalSettingsControl.xaml.cs
@@ -2,6 +2,7 @@
using NLog;
using ServerManagerTool.Common;
using ServerManagerTool.Common.Lib;
+using ServerManagerTool.Common.Model;
using ServerManagerTool.Common.Utils;
using System;
using System.Collections.Generic;
@@ -29,7 +30,7 @@ namespace ServerManagerTool
public static readonly DependencyProperty IsAdministratorProperty = DependencyProperty.Register(nameof(IsAdministrator), typeof(bool), typeof(GlobalSettingsControl), new PropertyMetadata(false));
public static readonly DependencyProperty CurrentConfigProperty = DependencyProperty.Register(nameof(CurrentConfig), typeof(Config), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty CommonConfigProperty = DependencyProperty.Register(nameof(CommonConfig), typeof(CommonConfig), typeof(GlobalSettingsControl), new PropertyMetadata(null));
- public static readonly DependencyProperty WindowStatesProperty = DependencyProperty.Register(nameof(WindowStates), typeof(List), typeof(GlobalSettingsControl), new PropertyMetadata(new List()));
+ public static readonly DependencyProperty WindowStatesProperty = DependencyProperty.Register(nameof(WindowStates), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public GlobalSettingsControl()
{
@@ -39,10 +40,11 @@ namespace ServerManagerTool
this.CommonConfig = CommonConfig.Default;
this.DataContext = this;
- this.WindowStates = new List();
- foreach (var windowState in Enum.GetValues(typeof(WindowState)))
+ this.WindowStates = new ComboBoxItemList();
+ foreach (WindowState windowState in Enum.GetValues(typeof(WindowState)))
{
- this.WindowStates.Add((WindowState)windowState);
+ var displayMember = _globalizer.GetResourceString($"WindowState_{windowState}") ?? windowState.ToString();
+ this.WindowStates.Add(new Common.Model.ComboBoxItem(windowState.ToString(), displayMember));
}
InitializeComponent();
@@ -75,9 +77,9 @@ namespace ServerManagerTool
set { SetValue(IsAdministratorProperty, value); }
}
- public List WindowStates
+ public ComboBoxItemList WindowStates
{
- get { return (List)GetValue(WindowStatesProperty); }
+ get { return (ComboBoxItemList)GetValue(WindowStatesProperty); }
set { SetValue(WindowStatesProperty, value); }
}