示例#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);
            }
        }
 private void HomeButtonOnButtonEvent(IButton button, ButtonEventArgs args)
 {
     UIShouldShowHomePage(ShowHomePageEventType.NotDefined);
 }