#675 Adds UserPromptedForCode event and method to show code on CiscoSparkCodec

This commit is contained in:
Neil Dorin
2021-04-05 17:01:34 -06:00
parent 3a4737b6f6
commit 1e755df9bb
2 changed files with 12 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
event EventHandler<EventArgs> UserCodeChanged;
event EventHandler<EventArgs> UserPromptedForCode;
string UserCode { get; }
string QrCodeUrl { get; }

View File

@@ -490,11 +490,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl);
mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge);
mcBridge.UserPromptedForCode += (o, a) => DisplayUserCode(mcBridge.UserCode);
SendMcBrandingUrl(mcBridge);
}
}
/// <summary>
/// Displays the code for the specified duration
/// </summary>
/// <param name="code">Mobile Control user code</param>
private void DisplayUserCode(string code)
{
SendText(string.Format("xcommand userinterface message alert display title:\"Mobile Control User Code:\" text:\"{0}\" duration: 30"));
}
private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge)
{
if (mcBridge == null)