//private string rememberVideoSavePath { get { return "RememberVideos\\"; } } public void loadRememberVideoData() { //加载最近观看视频数据 string lastVideos = WpStorage.ReadIsolatedStorageFile(lastVideosRememberIso); if (!string.IsNullOrEmpty(lastVideos)) { LastVideoRemember = JsonConvert.DeserializeObject <ObservableCollection <DownVideoInfoViewMoel> >(lastVideos); } else { LastVideoRemember = null; } //加载所有视频记录 string allVideos = WpStorage.ReadIsolatedStorageFile(VideosRememberIso); if (!string.IsNullOrEmpty(allVideos)) { RememberVideos = JsonConvert.DeserializeObject <ObservableCollection <DownVideoInfoViewMoel> >(allVideos); } else { RememberVideos = null; } }
public void loadLocalVideoData() { //加载正在下载视频数据 string loadingVideos = WpStorage.ReadIsolatedStorageFile(downingVideosIso); if (!string.IsNullOrEmpty(loadingVideos)) { DowningVideo = JsonConvert.DeserializeObject <ObservableCollection <DownVideoInfoViewMoel> >(loadingVideos); foreach (DownVideoInfoViewMoel video in DowningVideo) { DowningVideoids.Add(video.VideoId); } } else { DowningVideo = null; } //加载完成下载视频数据 string loadedVideos = WpStorage.ReadIsolatedStorageFile(downedVideosIso); if (!string.IsNullOrEmpty(loadedVideos)) { DownedVideo = JsonConvert.DeserializeObject <ObservableCollection <DownVideoInfoViewMoel> >(loadedVideos); foreach (DownVideoInfoViewMoel video in DownedVideo) { DownedVideoids.Add(video.VideoId); } } else { DownedVideo = null; } }
public void LoadChannels() { string strFileContent = string.Empty; if (!CommonData.ChannelLoaded) { if (WpStorage.isoFile.FileExists(CommonData.ChannelStorage)) { strFileContent = WpStorage.ReadIsolatedStorageFile(CommonData.ChannelStorage); } else { using (Stream stream = Application.GetResourceStream(new Uri("channels.txt", UriKind.Relative)).Stream) { using (StreamReader reader = new StreamReader(stream)) { strFileContent = reader.ReadToEnd(); } } } AllChannelsData channels = JsonConvert.DeserializeObject <AllChannelsData>(strFileContent); CommonData.LockedChannel = channels.lockedChannel; CommonData.NormalChannel = channels.normalChannel; } this.AllChannels.AddRange(CommonData.LockedChannel); this.AllChannels.AddRange(CommonData.NormalChannel); }