當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。