Removes the default from proces%type%Path mehods. If no path no change.

This commit is contained in:
JTA
2017-06-06 17:57:17 -04:00
parent 5c66579ab8
commit 6bc656f7bf
5 changed files with 24 additions and 19 deletions

Binary file not shown.

View File

@@ -118,36 +118,41 @@ namespace PepperDash.Core.JsonToSimpl
void ProcessBoolPath(ushort index) void ProcessBoolPath(ushort index)
{ {
string response; string response;
if (Process(BoolPaths[index], out response)) if (Process(BoolPaths[index], out response))
OnBoolChange(response.Equals("true", StringComparison.OrdinalIgnoreCase), OnBoolChange(response.Equals("true", StringComparison.OrdinalIgnoreCase),
index, JsonToSimplConstants.BoolValueChange); index, JsonToSimplConstants.BoolValueChange);
else else { }
OnBoolChange(false, index, JsonToSimplConstants.BoolValueChange);
} // OnBoolChange(false, index, JsonToSimplConstants.BoolValueChange);
}
// Processes the path to a ushort, converting to ushort if able, firing off UshrtChange event // Processes the path to a ushort, converting to ushort if able, firing off UshrtChange event
void ProcessUshortPath(ushort index) void ProcessUshortPath(ushort index)
{ {
string response; string response;
if (Process(UshortPaths[index], out response)) if (Process(UshortPaths[index], out response))
{ {
ushort val; ushort val;
try { val = Convert.ToUInt16(response); } try { val = Convert.ToUInt16(response); }
catch { val = 0; } catch
OnUShortChange(val, index, JsonToSimplConstants.UshortValueChange); {
} val = 0;
else }
OnUShortChange(0, index, JsonToSimplConstants.UshortValueChange); OnUShortChange(val, index, JsonToSimplConstants.UshortValueChange);
}
else { }
// OnUShortChange(0, index, JsonToSimplConstants.UshortValueChange);
} }
// Processes the path to a string property and fires of a StringChange event. // Processes the path to a string property and fires of a StringChange event.
void ProcessStringPath(ushort index) void ProcessStringPath(ushort index)
{ {
string response; string response;
if (Process(StringPaths[index], out response)) if (Process(StringPaths[index], out response))
OnStringChange(response, index, JsonToSimplConstants.StringValueChange); OnStringChange(response, index, JsonToSimplConstants.StringValueChange);
else else { }
OnStringChange("", index, JsonToSimplConstants.StringValueChange); // OnStringChange("", index, JsonToSimplConstants.StringValueChange);
} }
/// <summary> /// <summary>