示例#1
0
        protected override void SavePlayHistory(int duration, int position)
        {
            var parentId = _downloadInfo.ParentId;
            var parentName = _downloadInfo.ParentName;
            var image = _downloadInfo.ImageUri;
            var subId = _downloadInfo.ChannelId;
            var subName = _downloadInfo.Title;
            var index = _downloadInfo.ProgramIndex;

            var localInfo = new CloudDataInfo();
            localInfo.ProgramIndex = index;
            localInfo.ImageUri = image;
            localInfo.Id = parentId;
            localInfo.Name = parentName;
            localInfo.SubId = subId;
            localInfo.SubName = subName;
            localInfo.VideoType = 3;
            localInfo.Pos = position;
            localInfo.Duration = duration;

            LocalRecentFactory.Instance.InsertLocalRecord(localInfo);
        }
示例#2
0
 private void favourite_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (_dataSource != null && favourite.Style == App.Current.Resources["FavoriteAppButton"] as Style)
         {
             var v = new CloudDataInfo()
             {
                 Id = _dataSource.Id,
                 Name = _dataSource.Title,
                 SubId = _dataSource.Id,
                 SubName = _dataSource.Title,
                 Mark = _dataSource.Mark,
                 Duration = (int)(_dataSource.Duration * 60),
                 ImageUri = _dataSource.ImageUri
             };
             LocalFavoritesFactory.Instance.InsertLocalRecord(v);
             favourite.Style = App.Current.Resources["HasFavoriteAppButton"] as Style;
             TileUtils.CreateToastNotifications("收藏成功!");
             BottomAppBar.IsOpen = false;
         }
     }
     catch
     {
         TileUtils.CreateToastNotifications("收藏失败!");
     }
 }
示例#3
0
        protected override void SavePlayHistory(int duration, int position)
        {
            var parentId = _playInfo.ChannelDetailInfo.Id;
            var parentName = _playInfo.ChannelDetailInfo.Title;
            var image = _playInfo.ChannelDetailInfo.ImageUri;
            var subId = ChannelUtils.CreateChannelId(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo);
            var subName = ChannelUtils.CreateChannelTitle(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo, true);
            var index = ChannelUtils.CreateComonIndex(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo);

            if (parentId <= 0) return;

            var localInfo = new CloudDataInfo();
            localInfo.ProgramIndex = index;
            localInfo.ImageUri = image;
            localInfo.Id = parentId;
            localInfo.Name = parentName;
            localInfo.SubId = subId;
            localInfo.SubName = subName;
            localInfo.VideoType = 3;
            localInfo.Pos = position;
            localInfo.Duration = duration;

            LocalRecentFactory.Instance.InsertLocalRecord(localInfo);
        }
示例#4
0
 public void AddDeleteInfo(CloudDataInfo deleteInfo)
 {
     _needDeletes.Add(deleteInfo);
 }
示例#5
0
 private void WriteXmlItem(XmlWriter xmlWriter, CloudDataInfo item)
 {
     xmlWriter.WriteStartElement("Item");
     xmlWriter.WriteAttributeString("UUID", item.UUID);
     xmlWriter.WriteAttributeString("Device", item.Device.ToString());
     xmlWriter.WriteAttributeString("DeviceHistory", item.DeviceHistory.ToString());
     xmlWriter.WriteAttributeString("Id", item.Id.ToString());
     xmlWriter.WriteAttributeString("ClId", item.ClId.ToString());
     xmlWriter.WriteAttributeString("Name", item.Name);
     xmlWriter.WriteAttributeString("SubName", item.SubName);
     xmlWriter.WriteAttributeString("SubId", item.SubId.ToString());
     xmlWriter.WriteAttributeString("Pos", item.Pos.ToString());
     xmlWriter.WriteAttributeString("Duration", item.Duration.ToString());
     xmlWriter.WriteAttributeString("ModifyTime", item.ModifyTime.ToString());
     xmlWriter.WriteAttributeString("Property", item.Property.ToString());
     xmlWriter.WriteAttributeString("VideoType", item.VideoType.ToString());
     xmlWriter.WriteAttributeString("Bt", item.Bt.ToString());
     xmlWriter.WriteAttributeString("Mode", item.Mode.ToString());
     xmlWriter.WriteEndElement();
 }
示例#6
0
 private void ApplicationBarFav_Click(object sender, EventArgs e)
 {
     try
     {
         if (_dataSource != null && _favBar.Text == "收藏")
         {
             var v = new CloudDataInfo()
             {
                 Id = _dataSource.Id,
                 Name = _dataSource.Title,
                 SubId = _dataSource.Id,
                 SubName = _dataSource.Title,
                 Mark = _dataSource.Mark,
                 Duration = (int)(_dataSource.Duration * 60),
                 ImageUri = _dataSource.ImageUri
             };
             LocalFavoritesFactory.Instance.InsertLocalRecord(v);
             _favBar.IsEnabled = false;
             _favBar.Text = "已收藏";
             TileUtils.CreateBasicToast("收藏成功!");
         }
     }
     catch
     {
         TileUtils.CreateBasicToast("收藏失败!");
     }
 }