diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs index acbb4b37e6..f60d1b587f 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs @@ -121,7 +121,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel if (currentKey.GetValue("LocalizedString") != null) { - localizedStringRaw = currentKey.GetValue("LocalizedString").ToString().Split(new char[] { ',' }, 2); + localizedStringRaw = currentKey.GetValue("LocalizedString").ToString().Split(new string[] { ",-" }, StringSplitOptions.None); if (localizedStringRaw.Length > 1) { @@ -142,9 +142,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel localizedString = resource.ToString(); - /*This shouldn't be necessary, but some apps (e.g. Bootcamp) - * don't follow Microsoft's standard. Have to make a choice whether - * empty string == failure, or use default name. I'm using default name */ + //Some apps don't return a string, although they do have a stringIndex. Use Default value. if (String.IsNullOrEmpty(localizedString)) { @@ -184,7 +182,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel if (currentKey.GetValue("InfoTip") != null) { - infoTipRaw = currentKey.GetValue("InfoTip").ToString().Split(new char[] { ',' }, 2); + infoTipRaw = currentKey.GetValue("InfoTip").ToString().Split(new string[] { ",-" }, StringSplitOptions.None); if (infoTipRaw.Length == 2) { @@ -204,6 +202,10 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel infoTip = resource.ToString(); } + else + { + infoTip = currentKey.GetValue("InfoTip").ToString(); + } } else { @@ -298,12 +300,10 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel args = args.Remove(x); } - uint size; - if (uint.TryParse(args, out size)) - { - return size; - } - return 0; + /*If the logic is correct, this should never through an exception. + * If there is an exception, then need to analyze what the input is. + * Returning the wrong number will cause more errors */ + return Convert.ToUInt32(args); } private static bool IS_INTRESOURCE(IntPtr value)