private static void MsgReceived(object sender, EventArgs e) { if (LyncStatusWatcher.CurrentCallState == CallState.NoUpdate) { LedSdkAbstraction.FlashLighting(currentSdk, 0, 0, 100, 2000, 200); } }
static void SetLEDToCurrentStatus(Availability availability) { if (LyncStatusWatcher.CurrentCallState == CallState.Connected) { return; } switch (availability) { case Availability.DoNotDisturb: LedSdkAbstraction.SetLighting(currentSdk, 100, 0, 100); break; case Availability.Free: LedSdkAbstraction.SetLighting(currentSdk, 0, 100, 0); break; case Availability.Busy: LedSdkAbstraction.SetLighting(currentSdk, 100, 0, 0); break; case Availability.Away: case Availability.Idle: LedSdkAbstraction.SetLighting(currentSdk, 100, 75, 0); break; } }
private static void MsgStatusUpdated(MessageState state) { if (state == MessageState.New && LyncStatusWatcher.CurrentCallState == CallState.NoUpdate) { LedSdkAbstraction.FlashLighting(currentSdk, 0, 0, 100, 2000, 200); } ThreadPool.QueueUserWorkItem(FlashForWaitingMsg); }
private static void LyncStatusWatcher_ClientStatusChanged(bool clientRunning) { if (!clientRunning) { LedSdkAbstraction.Shutdown(currentSdk); } else { LedSdkAbstraction.Initialize(currentSdk, "Skype for Business Status"); SetLEDToCurrentStatus(LyncStatusWatcher.UserStatus); } }
private static void FlashForWaitingMsg(object state) { bool stillWaiting; do { Thread.Sleep(10000); stillWaiting = LyncStatusWatcher.CurrentMsgState == MessageState.New; if (stillWaiting && LyncStatusWatcher.CurrentCallState == CallState.NoUpdate) { LedSdkAbstraction.FlashLighting(currentSdk, 0, 0, 100, 1000, 200); } } while (stillWaiting); }
private static void CallStatusUpdated(CallState state) { switch (state) { case CallState.Ringing: LedSdkAbstraction.FlashLighting(currentSdk, 0, 0, 100, 120000, 200); break; case CallState.Connected: LedSdkAbstraction.PulseLighting(currentSdk, 100, 0, 0, 0, 800); //duration == 0 is infinite for Logitech. break; case CallState.NoUpdate: SetLEDToCurrentStatus(LyncStatusWatcher.UserStatus); break; } }