mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-01-30 12:54:46 +00:00
Adds method SetPathPrefix to JSON SiMPL Child Onject
Reinstated the default from proces%type%Path mehods. If no path no change propegates.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -62,6 +62,9 @@ namespace PepperDash.Core.JsonToSimpl
|
||||
Debug.Console(1, "JSON Child [{0}] cannot link to master {1}", key, masterUniqueId);
|
||||
}
|
||||
|
||||
public void SetPathPrefix(string pathPrefix) {
|
||||
PathPrefix = pathPrefix;
|
||||
}
|
||||
/// <summary>
|
||||
/// Set the JPath to evaluate for a given bool out index.
|
||||
/// </summary>
|
||||
@@ -121,23 +124,21 @@ namespace PepperDash.Core.JsonToSimpl
|
||||
if (Process(BoolPaths[index], out response))
|
||||
OnBoolChange(response.Equals("true", StringComparison.OrdinalIgnoreCase),
|
||||
index, JsonToSimplConstants.BoolValueChange);
|
||||
else
|
||||
OnBoolChange(false, index, JsonToSimplConstants.BoolValueChange);
|
||||
else { }
|
||||
// OnBoolChange(false, index, JsonToSimplConstants.BoolValueChange);
|
||||
}
|
||||
|
||||
// Processes the path to a ushort, converting to ushort if able, firing off UshrtChange event
|
||||
void ProcessUshortPath(ushort index)
|
||||
{
|
||||
string response;
|
||||
if (Process(UshortPaths[index], out response))
|
||||
{
|
||||
if (Process(UshortPaths[index], out response)) {
|
||||
ushort val;
|
||||
try { val = Convert.ToUInt16(response); }
|
||||
catch { val = 0; }
|
||||
try { val = Convert.ToUInt16(response); } catch { val = 0; }
|
||||
OnUShortChange(val, index, JsonToSimplConstants.UshortValueChange);
|
||||
}
|
||||
else
|
||||
OnUShortChange(0, index, JsonToSimplConstants.UshortValueChange);
|
||||
}
|
||||
else { }
|
||||
// OnUShortChange(0, index, JsonToSimplConstants.UshortValueChange);
|
||||
}
|
||||
|
||||
// Processes the path to a string property and fires of a StringChange event.
|
||||
@@ -146,8 +147,8 @@ namespace PepperDash.Core.JsonToSimpl
|
||||
string response;
|
||||
if (Process(StringPaths[index], out response))
|
||||
OnStringChange(response, index, JsonToSimplConstants.StringValueChange);
|
||||
else
|
||||
OnStringChange("", index, JsonToSimplConstants.StringValueChange);
|
||||
else { }
|
||||
// OnStringChange("", index, JsonToSimplConstants.StringValueChange);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -106,7 +106,9 @@ namespace PepperDash.Core.JsonToSimpl
|
||||
/// <param name="child"></param>
|
||||
public void AddChild(JsonToSimplChildObjectBase child)
|
||||
{
|
||||
if (Children.Contains(child)) return;
|
||||
if (Children.Contains(child)) {
|
||||
Children.Remove(child);
|
||||
}
|
||||
Children.Add(child);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user