Additional Compatibility code.

This commit is contained in:
Brett Hewitson 2021-12-03 11:09:29 +10:00
parent b45a855b42
commit b771a37592
5 changed files with 44 additions and 53 deletions

View file

@ -63,16 +63,16 @@ namespace ServerManagerTool.Plugin.Discord
{
get
{
var assembly = PluginHelper.Instance.GetType().Assembly;
var assembly = typeof(PluginHelper).Assembly;
if (assembly != null)
{
var pluginHelperType = assembly.GetType(typeof(PluginHelper).FullName, false, true);
if (pluginHelperType != null)
{
var field = pluginHelperType.GetProperty("LanguageCode");
if (field != null)
var property = pluginHelperType.GetProperty(nameof(LanguageCode));
if (property != null)
{
return field.GetValue(PluginHelper.Instance).ToString();
return property.GetValue(PluginHelper.Instance).ToString();
}
}
}