Exemplo n.º 1
0
 /// <summary>
 /// Gets the channel info.
 /// </summary>
 /// <param name="channelId">The channel id.</param>
 /// <returns></returns>
 public ChannelInfoResponse GetChannelInfo(uint channelId)
 {
     lock (Container.lockGetChannelInfo)
     {
         if (!Container.ChannelInfoList.ContainsKey(channelId))
         {
             Container.ChannelInfoList.Add(channelId, QueryRunner.GetChannelInfo(channelId));
         }
     }
     return(Container.ChannelInfoList[channelId]);
 }
        public void Store(QueryRunner QueryRunner, List <ChannelListEntry> ChannelList, ChannelInfoResponse ChannelInfo, ChannelListEntry Channel, Action <int, ChannelInfoResponse, ChannelListEntry> StoreMethod)
        {
            this.QueryRunner = QueryRunner;
            this.Parse(ChannelInfo, Channel);

            for (int i = 0; i < ChannelList.Count; i++)
            {
                if (ChannelList[i].ParentChannelId == Channel.ChannelId)
                {
                    var SubChannelInfo = QueryRunner.GetChannelInfo(ChannelList[i].ChannelId);
                    SubChannels.Add(new ChannelWithSubChannelsPackager(this.SubscriberId, this.SubscriberUniqueId, QueryRunner, ChannelList, SubChannelInfo, ChannelList[i], StoreMethod));
                }
            }

            StoreMethod.Invoke((int)this.ChannelId, ChannelInfo, Channel);
        }