Exemple #1
0
        private void ChannelButtonsOnButtonEvent(IButton button, ButtonEventArgs args)
        {
            if (args.EventType != ButtonEventType.Pressed)
            {
                return;
            }

            try
            {
                var channel = _channelList[args.CollectionKey].LinkedObject as Channel;
                TripleCare.SetChannel(ConfigManager.Config.TriplePlayServerAddress, _currentId, channel.Number);
            }
            catch (Exception e)
            {
                CloudLog.Exception(e, "Error trying to set channel");
            }
        }
Exemple #2
0
        protected override void WillShow()
        {
            base.WillShow();

            _tabs.ButtonEvent           += TabsOnButtonEvent;
            _channelButtons.ButtonEvent += ChannelButtonsOnButtonEvent;

            if (_currentId == 0)
            {
                _tabs.SetInterlockedFeedback(1);
                _currentId = _receiverIds[1];
            }

            Device.BooleanInput[Digitals.IptvTabsVisible].BoolValue = _receiverIds.Count > 1;

            TripleCare.GetChannels(ConfigManager.Config.TriplePlayServerAddress, -1, (success, channels) =>
            {
                if (success && channels != null)
                {
                    var channelOrder = channels
                                       .OrderBy(c => c.Number)
                                       .Take((int)_channelList.MaxNumberOfItems)
                                       .ToArray();

                    CloudLog.Debug("Received {0} channels from server", channelOrder.Count());
                    try
                    {
                        _channelList.ClearList(true);
                        foreach (var channel in channelOrder)
                        {
                            _channelList.AddItem(channel.Name, channel, true);
                        }
                        _channelList.SetListSizeToItemCount();
                    }
                    catch (Exception e)
                    {
                        CloudLog.Exception(e, "Error loading channels into list");
                    }
                }
                else
                {
                    CloudLog.Warn("Could not load channel list from server");
                }
            });
        }
 public void ChannelDown()
 {
     TripleCare.ChannelDown(ConfigManager.Config.TriplePlayServerAddress, ClientId);
 }