mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
New Globalisation Changes
This commit is contained in:
parent
034d7401d1
commit
d4859e0722
10 changed files with 23 additions and 103 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using ServerManagerTool.Plugin.Common;
|
||||
using ServerManagerTool.Plugin.Common.Events;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
|
@ -27,9 +26,8 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
try
|
||||
{
|
||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
||||
PluginHelper.Instance.ResourceDictionaryChanged += OnResourceDictionaryChanged;
|
||||
}
|
||||
catch
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
|
|
@ -88,16 +86,6 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
if (MessageBox.Show(ResourceUtils.GetResourceString(this.Resources, "ConfigProfileWindow_CloseLabel"), ResourceUtils.GetResourceString(this.Resources, "ConfigProfileWindow_CloseTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (!e.Cancel)
|
||||
PluginHelper.Instance.ResourceDictionaryChanged -= OnResourceDictionaryChanged;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
private void ComboBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
|
|
@ -305,20 +293,6 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
expression?.UpdateSource();
|
||||
}
|
||||
|
||||
private void OnResourceDictionaryChanged(object sender, ResourceDictionaryChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
|
||||
RefreshAlertTypeList();
|
||||
}
|
||||
|
||||
private void RefreshAlertTypeList()
|
||||
{
|
||||
var newList = new ComboBoxItemList();
|
||||
|
|
@ -356,7 +330,7 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
using ServerManagerTool.Plugin.Common;
|
||||
using ServerManagerTool.Plugin.Common.Events;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
|
@ -28,9 +24,8 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
try
|
||||
{
|
||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
||||
PluginHelper.Instance.ResourceDictionaryChanged += OnResourceDictionaryChanged;
|
||||
}
|
||||
catch
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
|
|
@ -78,16 +73,6 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
if (MessageBox.Show(ResourceUtils.GetResourceString(this.Resources, "ConfigWindow_CloseLabel"), ResourceUtils.GetResourceString(this.Resources, "ConfigWindow_CloseTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (!e.Cancel)
|
||||
PluginHelper.Instance.ResourceDictionaryChanged -= OnResourceDictionaryChanged;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
|
|
@ -291,18 +276,6 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
PluginConfig?.CommitChanges();
|
||||
}
|
||||
|
||||
private void OnResourceDictionaryChanged(object sender, ResourceDictionaryChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
}
|
||||
|
||||
#region Drag and Drop
|
||||
|
||||
private static readonly DependencyProperty DraggedItemProperty = DependencyProperty.Register(nameof(DraggedItem), typeof(ConfigProfile), typeof(ConfigWindow), new PropertyMetadata(null));
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:local="clr-namespace:ServerManagerTool.Plugin.Discord"
|
||||
xmlns:pc="clr-namespace:ServerManagerTool.Plugin.Common;assembly=ServerManager.Plugin.Common"
|
||||
MinWidth="400" MinHeight="400" Width="640" Height="480" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" ResizeMode="CanResizeWithGrip"
|
||||
Loaded="VersionFeedWindow_Loaded" Closing="VersionFeedWindow_Closing"
|
||||
Loaded="VersionFeedWindow_Loaded"
|
||||
Icon="../Art/favicon.ico" Title="{DynamicResource VersionFeedWindow_Title}">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using ServerManagerTool.Plugin.Common;
|
||||
using ServerManagerTool.Plugin.Common.Events;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
|
@ -23,9 +22,8 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
try
|
||||
{
|
||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
||||
PluginHelper.Instance.ResourceDictionaryChanged += OnResourceDictionaryChanged;
|
||||
}
|
||||
catch
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
|
|
@ -54,19 +52,6 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
set { SetValue(SelectedFeedEntryProperty, value); }
|
||||
}
|
||||
|
||||
private void VersionFeedWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!e.Cancel)
|
||||
PluginHelper.Instance.ResourceDictionaryChanged -= OnResourceDictionaryChanged;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
}
|
||||
|
||||
private void VersionFeedWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
|
|
@ -100,17 +85,5 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
|||
|
||||
SelectedFeedEntry = FeedEntries.OrderByDescending(e => e.Updated).FirstOrDefault();
|
||||
}
|
||||
|
||||
private void OnResourceDictionaryChanged(object sender, ResourceDictionaryChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, most likely they are using an older version of a server manager
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue