private void SourceButtonsOnButtonEvent(IButton button, ButtonEventArgs args) { if (args.EventType != ButtonEventType.Released) { return; } try { if (args.CollectionKey == 3 && Room.OtherRooms.Count > 0 && Room.OtherRooms.First().Source != null) { Room.Source = Room.OtherRooms.First().Source; return; } Room.Source = Room.Sources.ElementAt((int)args.CollectionKey - 1); } catch (ArgumentOutOfRangeException) { } catch (Exception e) { CloudLog.Exception(e); } }
private void PowerBtnOnButtonEvent(IButton button, ButtonEventArgs args) { if (args.EventType == ButtonEventType.Released) { Room.PowerOff(false, PowerOfFEventType.UserRequest); } }
private void ChanButtonsOnButtonEvent(IButton button, ButtonEventArgs args) { switch (args.EventType) { case ButtonEventType.Pressed: var tvSource = Room.Source as TVSource; if (tvSource == null) { return; } button.Feedback = true; switch (args.CollectionKey) { case 1: tvSource.ChannelUp(); break; case 2: tvSource.ChannelDown(); break; } break; case ButtonEventType.Tapped: break; case ButtonEventType.Held: break; case ButtonEventType.Released: button.Feedback = false; break; } }
private void BackButtonOnButtonEvent(IButton button, ButtonEventArgs args) { if (args.EventType != ButtonEventType.Released) { return; } BackButtonPressed(); }
private void AudioButtonsOnButtonEvent(IButton button, ButtonEventArgs args) { if (args.EventType != ButtonEventType.Released) { return; } var router = ((Gym)Room).AudioRouter; if (router != null) { router.SelectedInput = args.CollectionKey; args.Collection.SetInterlockedFeedback(args.CollectionKey); } }
private void HomeButtonOnButtonEvent(IButton button, ButtonEventArgs args) { UIShouldShowHomePage(ShowHomePageEventType.NotDefined); }