/// <summary>
 /// Determines whether the specified <see cref="ChannelDetail"/> is
 /// equal to the current <see cref="ChannelDetail"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="ChannelDetail"/> to compare with the current
 /// <see cref="ChannelDetail"/>.
 /// </param>
 /// <returns>
 /// <c>true</c> if the specified <see cref="ChannelDetail"/> is
 /// equal to the current <see cref="ChannelDetail"/>; otherwise,
 /// <c>false</c>.
 /// </returns>
 public bool Equals(ChannelDetail other)
 {
     return(other != null &&
            this.Id.Equals(other.Id) &&
            this.CallbackUrl.Equals(other.CallbackUrl) &&
            object.Equals(this.Filters, other.Filters));
 }
Beispiel #2
0
        public async Task Refresh()
        {
            ResetPage();
            var detail = await App.BiliViewModel._client.Channel.GetChannelDetailInfoAsync(_channelId);

            _detail = detail;
            if (_detail != null)
            {
                TagListView.Visibility = Visibility.Visible;
                if (detail.tags != null && detail.tags.Count > 0)
                {
                    detail.tags.ForEach(p => TagCollection.Add(p));
                }
                else
                {
                    TagListView.Visibility = Visibility.Collapsed;
                }
                TitleBlock.Text      = detail.title;
                SubscribeButton.Text = detail.is_atten == 1 ? "取消订阅" : "订阅";
                InfoBlock.Text       = $"{detail.label_1} | {detail.label_2} | {detail.label_3}";
                if (Convert.ToBoolean(VideoButton.IsChecked))
                {
                    await RefreshVideo();
                }
                else
                {
                    await RefreshTopic();
                }
                HolderContainer.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #3
0
        public ChannelDetail GetChannelDetail(string channelId)
        {
            ChannelDetail channelList         = new ChannelDetail();
            string        getChannelDetailUrl = url + "/ams/v3/getChannels?channelId=" + channelId;

            var response = InitiateWebRequest(getChannelDetailUrl);

            if (response.IsSuccessStatusCode)
            {
                channelList = response.Content.ReadAsAsync <ChannelDetail>().Result;
            }
            response.Dispose();

            return(channelList);
        }
Beispiel #4
0
        public ResultInfo <Info_TotalDataModel> GetChannelDetail(ChannelDetail parms)
        {
            ResultInfo <Info_TotalDataModel> result = new ResultInfo <Info_TotalDataModel>();

            try
            {
                result.ResultData = totalDataBll.FindChannelDetail(parms.id);
                result.ResultCode = EmResultDescribe.OK;
                LogInfo.InfoLogMessage("/Info_TotalData/GetChannelDetail", JsonConvert.SerializeObject(parms), JsonConvert.SerializeObject(result.ResultData));
            }
            catch (Exception ex)
            {
                result.ResultData = null;
                result.ResultCode = EmResultDescribe.系统错误;
                LogInfo.ErrorLogMessage("/Info_TotalData/GetChannelDetail", JsonConvert.SerializeObject(parms), JsonConvert.SerializeObject(result.ResultData), ex.Message);
            }
            return(result);
        }
Beispiel #5
0
        private void ResetPage()
        {
            _isInit = false;

            HolderContainer.Visibility = Visibility.Visible;
            TagCollection.Clear();
            TagListView.Visibility = Visibility.Collapsed;
            _detail                         = null;
            TitleBlock.Text                 = "--";
            SubscribeButton.Text            = "--";
            InfoBlock.Text                  = "--";
            _sortType                       = "hot";
            _videoOffset                    = "";
            _topicOffset                    = "";
            VideoSortComboBox.SelectedIndex = 0;
            VideoCollection.Clear();
            TopicCollection.Clear();

            HeaderVideoContainer.Visibility = Visibility.Collapsed;
            _isVideoRequesting = false;

            _isInit = true;
        }
 /// <summary>
 /// Determines whether the specified <see cref="ChannelDetail"/> is
 /// equal to the current <see cref="ChannelDetail"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="ChannelDetail"/> to compare with the current
 /// <see cref="ChannelDetail"/>.
 /// </param>
 /// <returns>
 /// <c>true</c> if the specified <see cref="ChannelDetail"/> is
 /// equal to the current <see cref="ChannelDetail"/>; otherwise,
 /// <c>false</c>.
 /// </returns>
 public bool Equals(ChannelDetail other)
 {
     return other != null
         && this.Id.Equals(other.Id)
         && this.CallbackUrl.Equals(other.CallbackUrl)
         && object.Equals(this.Filters, other.Filters);
 }