New Globalisation Changes

This commit is contained in:
Brett Hewitson 2021-12-03 10:00:04 +10:00
parent 034d7401d1
commit d4859e0722
10 changed files with 23 additions and 103 deletions

View file

@ -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
}