Control Panel Split Logic

This commit is contained in:
Coenraad Stijne
2014-07-19 12:39:26 +02:00
parent fcd276dccb
commit a5d63bc383

View File

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