Adds CustomUnregisterWithAppServer method to allow unregistration at runtime

This commit is contained in:
Neil Dorin
2019-12-10 14:28:20 -07:00
parent 5819ac78ec
commit c54351f8ee
3 changed files with 32 additions and 7 deletions

View File

@@ -34,7 +34,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, (s) => SendRoutingFullMessageObject(s));
}
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
{
appServerController.AddAction(MessagePath + "/fullStatus", new Action(() =>
@@ -42,13 +41,21 @@ namespace PepperDash.Essentials.AppServer.Messengers
SendRoutingFullMessageObject(EISC.GetString(JoinStart + StringJoin.CurrentSource));
}));
appServerController.AddAction(string.Format(@"/device/inRoomPc-1/source"), new Action<SourceSelectMessageContent>(c =>
appServerController.AddAction(MessagePath +"/source", new Action<SourceSelectMessageContent>(c =>
{
EISC.SetString(JoinStart + StringJoin.CurrentSource, c.SourceListItem);
}));
}
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
{
appServerController.RemoveAction(MessagePath + "/fullStatus");
appServerController.RemoveAction(MessagePath + "/source");
EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, null);
}
/// <summary>
/// Helper method to update full status of the routing device
/// </summary>