Add logic to subscribe to PhoneBookSyncState during the CustomActivate method within CiscoSparkCodec class

This commit is contained in:
Jonathan Arndt
2022-02-08 16:24:54 -08:00
parent 64352811c5
commit 93bfcc7baa
3 changed files with 59 additions and 15 deletions

View File

@@ -590,9 +590,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CrestronConsole.AddNewConsoleCommand(GetPhonebook, "GetCodecPhonebook", "Triggers a refresh of the codec phonebook", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(GetBookings, "GetCodecBookings", "Triggers a refresh of the booking data for today", ConsoleAccessLevelEnum.AccessOperator);
PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
return base.CustomActivate();
}
void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
{
OnDirectoryResultReturned(DirectoryRoot);
}
#region Overrides of Device
public override void Initialize()
@@ -1144,6 +1151,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
var handler = DirectoryResultReturned;
if (handler != null)
{
Debug.Console(2, this, "Directory result returned");
handler(this, new DirectoryEventArgs()
{
Directory = result,