예제 #1
0
        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);
            }
        }
예제 #2
0
 private void PowerBtnOnButtonEvent(IButton button, ButtonEventArgs args)
 {
     if (args.EventType == ButtonEventType.Released)
     {
         Room.PowerOff(false, PowerOfFEventType.UserRequest);
     }
 }
예제 #3
0
        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;
            }
        }
예제 #4
0
 private void BackButtonOnButtonEvent(IButton button, ButtonEventArgs args)
 {
     if (args.EventType != ButtonEventType.Released)
     {
         return;
     }
     BackButtonPressed();
 }
예제 #5
0
        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);
            }
        }
예제 #6
0
 private void HomeButtonOnButtonEvent(IButton button, ButtonEventArgs args)
 {
     UIShouldShowHomePage(ShowHomePageEventType.NotDefined);
 }