当前位置: 首页>>代码示例>>C#>>正文


C# Channel.ReferringChannelMap方法代码示例

本文整理汇总了C#中TvDatabase.Channel.ReferringChannelMap方法的典型用法代码示例。如果您正苦于以下问题:C# Channel.ReferringChannelMap方法的具体用法?C# Channel.ReferringChannelMap怎么用?C# Channel.ReferringChannelMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TvDatabase.Channel的用法示例。


在下文中一共展示了Channel.ReferringChannelMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: comparecardmappings

        public bool comparecardmappings(Channel channel1, Channel channel2)
        {
            #if(MP100)
            IList allmaps1 = channel1.ReferringChannelMap();
            #elif(MP101)
            IList<ChannelMap> allmaps1 = channel1.ReferringChannelMap();
            #else //MP11BETA or SVN
            IList<ChannelMap> allmaps1 = channel1.ReferringChannelMap();
            #endif

            ChannelMap[] channelmap1 = new ChannelMap[allmaps1.Count];
            int i = 0;
            foreach (ChannelMap map1 in allmaps1)
            {
                channelmap1[i++] = map1;
            }

            #if(MP100)
            IList allmaps2 = channel2.ReferringChannelMap();
            #elif(MP101)
            IList<ChannelMap> allmaps2 = channel2.ReferringChannelMap();
            #else //MP11BETA or SVN
            IList<ChannelMap> allmaps2 = channel2.ReferringChannelMap();
            #endif

            ChannelMap[] channelmap2 = new ChannelMap[allmaps2.Count];
            i = 0;
            foreach (ChannelMap map2 in allmaps2)
            {
                channelmap2[i++] = map2;
            }

            if (allmaps1.Count != allmaps2.Count)  //cardmap count not equal
                return false;

            for (i = 0; i < allmaps1.Count; i++)
            {
                if (channelmap1[i].IdCard != channelmap2[i].IdCard) //different cards
                    return false;
            }

            //    textoutput("Cardmappings equal for channel " + channel1.IdChannel + " and channel " + channel2.IdChannel);

            return true;
        }
开发者ID:huha001,项目名称:BackupSettings,代码行数:45,代码来源:BackupSettingsExportImport.cs

示例2: CreateListViewItemForChannel

    /// <summary>
    /// Create a listview item for a channel
    /// </summary>
    /// <param name="ch">Channel</param>
    /// <param name="cards">All available cards</param>
    /// <returns>Listview item representing the channel</returns>
    internal ListViewItem CreateListViewItemForChannel(Channel ch, Dictionary<int, CardType> cards)
    {
      if (_listViewCache.ContainsKey(ch.IdChannel)) return _listViewCache[ch.IdChannel];

      bool analog = false;
      bool dvbc = false;
      bool dvbt = false;
      bool dvbs = false;
      bool atsc = false;
      bool dvbip = false;
      bool webstream = false;
      bool notmapped = true;
      if (ch.IsWebstream())
      {
        webstream = true;
        notmapped = false;
      }
      if (notmapped)
      {
        IList<ChannelMap> maps = ch.ReferringChannelMap();
        foreach (ChannelMap map in maps)
        {
          if (cards.ContainsKey(map.IdCard))
          {
            CardType type = cards[map.IdCard];
            switch (type)
            {
              case CardType.Analog:
                analog = true;
                notmapped = false;
                break;
              case CardType.DvbC:
                dvbc = true;
                notmapped = false;
                break;
              case CardType.DvbT:
                dvbt = true;
                notmapped = false;
                break;
              case CardType.DvbS:
                dvbs = true;
                notmapped = false;
                break;
              case CardType.Atsc:
                atsc = true;
                notmapped = false;
                break;
              case CardType.DvbIP:
                dvbip = true;
                notmapped = false;
                break;
            }
          }
        }
      }
      ListViewItem item = new ListViewItem(ch.DisplayName);
      item.Checked = ch.VisibleInGuide;
      item.Tag = ch;


      IList<string> groups = ch.GroupNames;
      List<string> groupNames = new List<string>();
      foreach (string groupName in groups)
      {
        if (groupName != TvConstants.TvGroupNames.AllChannels &&
            groupName != TvConstants.RadioGroupNames.AllChannels)
        {
//Don't add "All Channels"
          groupNames.Add(groupName);
        }
      }
      string group = String.Join(", ", groupNames.ToArray());
      item.SubItems.Add(group);

      List<string> providers = new List<string>();
      IList<TuningDetail> tuningDetails = ch.ReferringTuningDetail();
      bool hasFta = false;
      bool hasScrambled = false;
      foreach (TuningDetail detail in tuningDetails)
      {
        if (!providers.Contains(detail.Provider) && !String.IsNullOrEmpty(detail.Provider))
        {
          providers.Add(detail.Provider);
        }
        if (detail.FreeToAir)
        {
          hasFta = true;
        }
        if (!detail.FreeToAir)
        {
          hasScrambled = true;
        }
      }

//.........这里部分代码省略.........
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:101,代码来源:ChannelListViewHandler.cs


注:本文中的TvDatabase.Channel.ReferringChannelMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。