void coverFactory_GetCoverInfosSuccess(object sender, HttpFactoryArgs <List <CoverInfo> > args) { loadingTip.Visibility = Visibility.Collapsed; if (args.Result.Count <= 0) { return; } var group = new ChannelCoverGroup(); group.ItemsGroup = new ObservableCollection <ChannelCoverItem>(); group.GroupName = _coverNavs[_coverNavIndex].Name; _coverViewModel.Groups.Add(group); foreach (var cover in args.Result) { group.ItemsGroup.Add(new ChannelCoverItem() { ChannelId = cover.Vid, Title = cover.Title, ImageUri = cover.ImageUri, Note = cover.Note }); } getCoverList(); }
private void channelFactory_HttpSucessed(object sender, HttpFactoryArgs <ChannelSearchInfo> e) { loadingTip.Visibility = Visibility.Collapsed; if (e.Result.Lists.Count > 0) { searchCatalogComboBox.Visibility = Visibility.Visible; noResultGrid.Visibility = Visibility.Collapsed; _maxPage = e.Result.OutlineInfo.PageCount; foreach (var channelInfo in e.Result.Lists) { _searchViewModel.Items.Add(channelInfo); } if (_searchViewModel.Navs.Count == 0) { var totalCount = 0; foreach (var nav in e.Result.Navs) { totalCount += nav.Count; _searchViewModel.Navs.Add(CommonUtils.CreateComoboxItem(string.Format("{0}({1})", nav.Name, nav.Count), nav.Id)); } _searchViewModel.Navs.Insert(0, CommonUtils.CreateComoboxItem(string.Format("{0}({1})", "全部", totalCount), 0)); searchCatalogComboBox.SelectedIndex = 0; } } else { NoResult(); } }
private async void channelDetailFactory_Successed(object sender, HttpFactoryArgs<ChannelDetailInfo> e) { _dataSource = e.Result; if (_dataSource.IsNumber) channelList.GridCellSize = new Size(154, 147); else channelList.GridCellSize = new Size(154, 195); if (_dataSource.ProgramInfos == null) { TileUtils.CreateBasicToast("该节目信息不存在!"); NavigationService.GoBack(); return; } if (!_dataSource.IsNumber && _dataSource.ProgramInfos.Count == 1) _dataSource.ProgramInfos[0].Title = string.Format("{0} 全一集", _dataSource.ProgramInfos[0].Title); DataContext = _dataSource; channelList.ItemsSource = _dataSource.ProgramInfos; downloadList.ItemsSource = _dataSource.ProgramInfos; await UpdateDownloadState(); loadingTip.Visibility = Visibility.Collapsed; //ShareUtils.ShareInfo = new PlayShareInfo(_dataSource.Id, _dataSource.Title, _dataSource.ImageUri); }
void _channelFactory_GetChannelsByListSucceed(object sender, HttpFactoryArgs <VodChannelListInfo> args) { _getDataStatusHelp.Clear(); var channelInfos = args.Result.Channels; var channel_count = args.Result.ChannelCount; var page_count = args.Result.PageCount; _isLoadingData = false; _channel_count = channel_count; _page_count = page_count; if (_isLongItem) { foreach (ChannelInfo item in channelInfos) { item.SlotUrl = item.SlotUrl.Substring(0, item.SlotUrl.IndexOf(".jpg")) + "_165.jpg"; ChannelInfos.Add(item); } } else//small { foreach (ChannelInfo item in channelInfos) { ChannelInfos.Add(item); } int currentIndex = 0; for (int i = 0; i < ChannelInfos.Count; i++) { if (currentIndex < i || i == 0) { ObservableCollection <ChannelInfo> tempChannelInfos = new ObservableCollection <ChannelInfo>(); for (int j = 0; j < 3; j++) { currentIndex = i + j; LogManager.Ins.DebugLog(currentIndex + ""); if (currentIndex < channelInfos.Count) { tempChannelInfos.Add(channelInfos[currentIndex]); Debug.WriteLine("添加了" + currentIndex); } } AllOneRow3ChannelInfos.Add(tempChannelInfos); } } Debug.WriteLine("总个数:" + (_isLongItem ? ChannelInfos.Count : AllOneRow3ChannelInfos.Count)); } if (_isLongItem ? ChannelInfos.Count == 0 : AllOneRow3ChannelInfos.Count == 0) { xChannelsListBox.Visibility = Visibility.Collapsed; xNullTextBlock.Text = "暂无节目"; xNullTextBlock.Visibility = Visibility.Visible; } else { xChannelsListBox.Visibility = Visibility.Visible; xNullTextBlock.Visibility = Visibility.Collapsed; } xLoadChannelsGrid.Visibility = Visibility.Collapsed; }
private void typeFactory_HttpSucess(object sender, HttpFactoryArgs <List <TypeInfo> > args) { var selectGroup = new ChannelTypeGroup(); selectGroup.GroupName = "已固定"; selectGroup.ItemsGroup = new ObservableCollection <ChannelTypeItem>(); var unSelectGroup = new ChannelTypeGroup(); unSelectGroup.GroupName = "未固定"; unSelectGroup.ItemsGroup = new ObservableCollection <ChannelTypeItem>(); _allViewModel.Groups.Add(selectGroup); _allViewModel.Groups.Add(unSelectGroup); var roamingValue = DataStoreUtils.GetRoamingSettingValue(_channelTypeSettingKey) as string; if (string.IsNullOrEmpty(roamingValue)) { roamingValue = string.Join("/", args.Result.Take(ColNumber * 2).Select(v => v.TypeId.ToString())); } var firstLaunch = DataStoreUtils.GetLocalSettingValue(_channelTypeSettingKey) as string; if (string.IsNullOrEmpty(firstLaunch)) { if (!roamingValue.Contains("75099")) { roamingValue = roamingValue.Insert(0, "75099/"); roamingValue = roamingValue.Remove(roamingValue.LastIndexOf('/')); } if (!roamingValue.Contains(LiveTypeId.ToString())) { roamingValue = roamingValue.Insert(0, string.Format("{0}/", LiveTypeId.ToString())); roamingValue = roamingValue.Remove(roamingValue.LastIndexOf('/')); } DataStoreUtils.AddLocalSettingValue(_channelTypeSettingKey, "1"); DataStoreUtils.AddRoamingSettingValue(_channelTypeSettingKey, roamingValue); } _isReorder = false; var selectValues = roamingValue.Split('/'); foreach (var type in args.Result) { ProcessViewModel(selectValues, type.TypeId, type.Name); } foreach (var type in _localTypes) { ProcessViewModel(selectValues, type.TypeId, type.TypeName); } foreach (var selected in selectValues) { var item = _allViewModel.Groups[0].ItemsGroup.FirstOrDefault(v => v.TypeId == Convert.ToInt32(selected)); if (item != null) { _selectedViewModel.Add(item); } } }
void listFactory_HttpSucessed(object sender, HttpFactoryArgs<LiveArgs> e) { var page = CommonUtils.GetCurrentPage() as LiveChannelPage; if (page == null) return; page.LoadingTipVisibility = Visibility.Collapsed; LiveListGroup group = null; //if (Tag.ToString() == LiveType.Recommend.CreateString()) // group = page.ViewModel.Groups[0]; if (Tag.ToString() == LiveType.Sports.CreateString()) group = page.ViewModel.Groups[2]; else group = page.ViewModel.Groups[3]; var newCount = e.Result.Channels.Count; group.ItemsGroup.PerformanceClear(); for (var i = 0; i < newCount; i++) { group.ItemsGroup.Add(new LiveListItem() { ChannelInfo = e.Result.Channels[i] }); } if (newCount <= 0) { group.ItemsGroup.Add(new LiveListItem() { ChannelInfo = new LiveChannelInfo(LiveType.Sports) { Id = 0, Title = string.Format("暂无{0}节目", group.GroupName), StartTime = DateTime.Now.AddDays(1) } }); } }
void listFactory_HttpSucessed(object sender, HttpFactoryArgs <LiveArgs> e) { LiveListGroup group = null; IEnumerable <LiveChannelInfo> list = e.Result.Channels; if (_isClickMore) { CloseTips(); group = _viewModel.Groups[_groupIndex]; list = list.Skip(_colCount * 2); } else { group = CreateGroup(e.Result.GroupName); } if (_groupIndex == 0) { this.DefaultViewModel["SatelliteSource"] = group.ItemsGroup; } else { this.DefaultViewModel["LocalTVSource"] = group.ItemsGroup; } CreateItems(group, list); if (!_isClickMore) { GetLiveList(); } }
private void OnGetChannelsBySearchSucceed(object sender, HttpFactoryArgs<VodChannelListInfo> args) { LoadingWait.Visibility = Visibility.Collapsed; var result = args.Result.Channels; ResultCount.Text = String.Format("共找到{0}条结果", result.Count); xSearchResult.ItemsSource = result; }
void _tagFactoryOfCatalog_GetTagsSucceed(object sender, HttpFactoryArgs <TagFactoryInfo> args) { LogManager.Ins.Log("下载守Catalog数据Tag"); SetDownloadStatus(false); _tagInfosOfCatalog = args.Result.Tags; InitElement(xCatalogListBox, _tagInfosOfCatalog); }
void _playInfoFactory_HttpSucceed(object sender, HttpFactoryArgs <Object> args) { _playMessage.PlayInfos = _playInfoFactory.PlayInfos; _playMessage.HasPreProgram = ChannelUtils.CreatePreviousIndex(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo) >= 0 ? true : false; _playMessage.HasNextProgram = ChannelUtils.CreateNextIndex(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo) >= 0 ? true : false; _playMessage.ShareInfo = new PlayShareInfo( ChannelUtils.CreateChannelId(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo), _playMessage.Title, _playInfo.ChannelDetailInfo.ImageUri); var info = _playInfoFactory.CreatePlayInfo(_playFileType); if (info != null) { _playMessage.CurrentPlayInfo = info; Play(info); if (PlayMessageAction != null) { PlayMessageAction(_playMessage); } } else { if (PlayErrorAction != null) { PlayErrorAction("无法获取影片播放地址"); } } }
private void channelFactory_GetChannelsByListSucceed(object sender, HttpFactoryArgs <VodChannelListInfo> e) { loadingTip.Visibility = Visibility.Collapsed; _maxPage = e.Result.PageCount; ChannelListGroup group = null; for (int i = 0; i < e.Result.Channels.Count; i++) { if (i % _groupNmu == 0) { group = new ChannelListGroup(); group.ItemsGroup = new ObservableCollection <ChannelListItem>(); _channelViewModel.Groups.Add(group); } group.ItemsGroup.Add(new ChannelListItem() { ChannelId = e.Result.Channels[i].Id, ChannelFlag = e.Result.Channels[i].ChannelFlag, TypeInfo = _typeItem, Mark = e.Result.Channels[i].Mark, ImageUri = ChannelTypeFactory.Instance.GetItemImage(_typeItem.TypeName, e.Result.Channels[i]), Title = e.Result.Channels[i].Title }); } }
private async void channelDetailFactory_Successed(object sender, HttpFactoryArgs <ChannelDetailInfo> e) { _dataSource = e.Result; if (_dataSource.IsNumber) { channelList.GridCellSize = new Size(154, 147); } else { channelList.GridCellSize = new Size(154, 195); } if (_dataSource.ProgramInfos == null) { TileUtils.CreateBasicToast("该节目信息不存在!"); NavigationService.GoBack(); return; } if (!_dataSource.IsNumber && _dataSource.ProgramInfos.Count == 1) { _dataSource.ProgramInfos[0].Title = string.Format("{0} 全一集", _dataSource.ProgramInfos[0].Title); } DataContext = _dataSource; channelList.ItemsSource = _dataSource.ProgramInfos; downloadList.ItemsSource = _dataSource.ProgramInfos; await UpdateDownloadState(); loadingTip.Visibility = Visibility.Collapsed; //ShareUtils.ShareInfo = new PlayShareInfo(_dataSource.Id, _dataSource.Title, _dataSource.ImageUri); }
void recommendChannelFactory_GetChannelsSucceed(object sender, HttpFactoryArgs <VodChannelListInfo> e) { loadingTip.Visibility = Visibility.Collapsed; _maxPage = e.Result.PageCount; ChannelRecommendGroup group = null; for (int i = 0; i < e.Result.Channels.Count; i++) { if (i % _groupNum == 0) { group = new ChannelRecommendGroup(); group.ItemsGroup = new ObservableCollection <ChannelRecommendListItem>(); _recommendViewModel.Groups.Add(group); } group.ItemsGroup.Add(new ChannelRecommendListItem { ChannelId = e.Result.Channels[i].Id, ChannelFlag = e.Result.Channels[i].ChannelFlag, Mark = e.Result.Channels[i].Mark, ImageUri = e.Result.Channels[i].ImageUri, Title = e.Result.Channels[i].Title, Act = e.Result.Channels[i].Act, Duration = e.Result.Channels[i].Duration }); } }
private void hotSearchFactory_HttpSucessed(object sender, HttpFactoryArgs <List <HotSearchInfo> > e) { _searchViewModel.HotNames = e.Result; movieHotSearch.ItemsSource = _searchViewModel.HotNames.Where(v => v.Type == ChannelTypeFactory.Instance.GetChannelTypeId("电影")); tvHotSearch.ItemsSource = _searchViewModel.HotNames.Where(v => v.Type == ChannelTypeFactory.Instance.GetChannelTypeId("电视剧")); cartoonHotSearch.ItemsSource = _searchViewModel.HotNames.Where(v => v.Type == ChannelTypeFactory.Instance.GetChannelTypeId("动漫")); amuseHotSearch.ItemsSource = _searchViewModel.HotNames.Where(v => v.Type == ChannelTypeFactory.Instance.GetChannelTypeId("综艺")); }
void _tagFactoryOfCatalog_GetTagsFailed(object sender, HttpFactoryArgs <TagFactoryInfo> args) { xCatalogProgressBar.Visibility = Visibility.Collapsed; if (DataDownloadFailed != null) { DataDownloadFailed(sender, null); } }
void _tagFactoryOfArea_GetTagsSucceed(object sender, HttpFactoryArgs <TagFactoryInfo> args) { LogManager.Ins.Log("下载守Aear数据Tag"); SetDownloadStatus(false); _tagInfosOfArea = args.Result.Tags; InitElement(xAreaListBox, _tagInfosOfArea); }
void _channelDetailFactory_GetChannelDetailByVIDSucceed(object sender, HttpFactoryArgs <ChannelDetailInfo> args) { ChannelDetailInfo = args.Result; LogManager.Ins.Log("ChannelDetailInfo信息下载成功"); BeginGetInfoNPlay(); //_isPlayProgram = false; }
void _playInfoFactory_GetPlayInfoTimeout(object sender, HttpFactoryArgs <PlayInfo> args) { MessageBox.Show("获取播放信息超时", "提示", MessageBoxButton.OK); if (NavigationService.CanGoBack) { NavigationService.GoBack(); } }
void playFac_GetPlayInfoSucceed(object sender, HttpFactoryArgs <PlayInfo> args) { ProgramInfo curProgramInfo = _downProgramInfo[sender as PlayInfoFactory]; PlayInfo.Item item = args.Result.GetItemByFileType(5); if (item == null) { // _downSign.Visibility = Visibility.Collapsed; _downSign.Foreground = new SolidColorBrush(Colors.White); if (_piForDownload != null) { _piForDownload.IsDown = Visibility.Collapsed; } string id = string.Empty; if (curProgramInfo == null) { id = DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||"; } else { id = DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + curProgramInfo.Index + "|" + curProgramInfo.ChannelVID; } foreach (DownPage.DownInfo info in DownPage.MyDownloading) { if (info.VID == id) { DownPage.MyDownloading.Remove(info); break; } } DownPage.DownFactory.DeleteRecord(id); MessageBox.Show("无法下载该文件", "提示", MessageBoxButton.OK); return; } _rid = item.Rid; if (item.DtInfo != null) { _downUrl = item.url; if (curProgramInfo == null) { DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||", _downUrl); } else { DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + curProgramInfo.Index + "|" + curProgramInfo.ChannelVID, _downUrl); } } else { string jump_url = "http://wp7.jump.synacast.com/" + item.Rid + "dt?type=mwp7"; PPTVData.HttpWebClient jumpWebClient = new PPTVData.HttpWebClient(); jumpWebClient.DownloadStringCompleted += new PPTVData.DownloadStringCompletedEventHandler(JumpWebClientDownloadStringCompleted); jumpWebClient.DownloadStringAsync(jump_url); } }
private void loginFactory_HttpSurcess(object sender, HttpFactoryArgs <UserStateInfo> e) { if (e.Result.UserState == 0) { var personInfo = PersonalFactory.Instance.DataInfos[0]; personInfo.UserStateInfo = e.Result; PersonalFactory.Instance.SubmitChange(); } }
void _channelDetailFactory_GetChannelDetailTimeout(object sender, HttpFactoryArgs <ChannelDetailInfo> args) { SetInfo(false, string.Empty, false); MessageBox.Show("连接超时,获取影片信息失败!"); if (NavigationService.CanGoBack) { NavigationService.GoBack(); } }
void _channelDetailFactory_GetChannelDetailByVIDFailed(object sender, HttpFactoryArgs <ChannelDetailInfo> args) { SetInfo(false, "", false); MessageBox.Show("获取影片信息失败!"); if (NavigationService.CanGoBack) { NavigationService.GoBack(); } }
void _recommendCoverNavFactory_GetRecommendNavSucceed(object sender, HttpFactoryArgs <List <RecommendNav> > args) { _recommendNavsByCovers = args.Result; if (args.Result.Count > 0) { _selectedRecommendNavCover = _recommendNavsByCovers[0]; xCoverBar.BeginDownload(_selectedRecommendNavCover.Navid); } }
void coverFactory_GetCoverInfosSuccess(object sender, HttpFactoryArgs <List <CoverInfo> > args) { var random = new Random(); if (args.Result.Count > 0) { _covers = args.Result; Calculate(_covers.Count); InitElements(); } }
private void playFac_GetPlayInfoFailed(object sender, HttpFactoryArgs <PPTVData.Entity.PlayInfo> args) { foreach (DownInfo info in MyDownloading) { if (info.VID == _vid) { info.StatusImage = "/PPTVForWP7;component/Images/png.png"; break; } } }
private void OnGetRecommendNavSucceeded(object sender, HttpFactoryArgs <List <RecommendNav> > args) { //获取到导航菜单后 _getDataStatusHelp.Clear(); if (args.Result.Count > 0) { _selectedRecommendNavChannel = args.Result[0]; _channelFactoryByRecommendNav.DownLoadDatas(1, _selectedRecommendNavChannel.Navid, 100); } }
void recommandNav_Successed(object sender, HttpFactoryArgs <List <RecommandNav> > args) { RecommandNavs = args.Result.Take(5).ToList(); if (RecommandNavs.Count > 0) { _currentRecIndex = 0; _recommendChannelFactory = new RecommendListFactory(); _recommendChannelFactory.HttpSucessHandler += recommandChannelFactory_GetChannelsSucceed; _recommendChannelFactory.HttpFailorTimeOut += http_FailorTimeOut; getRecommand(); } }
void coverNav_Successed(object sender, HttpFactoryArgs<List<RecommandNav>> args) { _coverChannelFactory = new CoverListFactory(); _coverChannelFactory.HttpSucessHandler += coverFactory_GetCoverInfosSuccess; if (_httpFailorTimeOut != null) _coverChannelFactory.HttpFailorTimeOut = _httpFailorTimeOut; if (args.Result.Count > 0) { var random = new Random(); var index = random.Next(0, args.Result.Count - 1); _coverChannelFactory.DownLoadDatas(args.Result[index].Navid); } }
void _channelFactory_GetChannelsByListFailed(object sender, HttpFactoryArgs <VodChannelListInfo> args) { _pageIndex--; if (_pageIndex < 1) { _pageIndex = 1; } xLogTextBlock.Text = "加载新的数据失败 _pageIndex:" + _pageIndex + " 电影个数:" + (_isLongItem ? ChannelInfos.Count : AllOneRow3ChannelInfos.Count); xLoadChannelsGrid.Visibility = Visibility.Collapsed; xChannelsListBox.Visibility = Visibility.Collapsed; xNullTextBlock.Text = "加载数据失败"; xNullTextBlock.Visibility = Visibility.Visible; _isLoadingData = false; }
private void LoginFactory_Sucess(object sender, HttpFactoryArgs <UserStateInfo> e) { loadingTip.Visibility = Visibility.Collapsed; var userInfo = e.Result; if (userInfo.UserState == 0) { var personalInfo = new PersonalInfo(); personalInfo.IsSaveInfo = toggleUserInfo.IsChecked.Value; personalInfo.IsAutoLogin = toggleAutoLogin.IsChecked.Value; personalInfo.UserPassWord = PPTVData.Utils.DataCommonUtils.Encode(txtPassWord.Password, Utils.Constants.PasswordKey); personalInfo.UserStateInfo = e.Result; personalInfo.IsCurrentLogin = true; PersonalFactory.Instance.InsertRecord(personalInfo); if (NavigationService.CanGoBack) { NavigationService.GoBack(); } if (LoginSucessHandler != null) { LoginSucessHandler(); } } else { var response = string.Empty; switch (userInfo.UserState) { case 1: response = "该用户名不存在"; break; case 2: response = "密码错误"; break; case 3: response = "该用户已锁定"; break; case 4: response = "该用户已过期"; break; case 5: response = "该用户已删除"; break; default: response = "登录失败"; break; } TileUtils.CreateBasicToast(response); } }
void coverNav_Successed(object sender, HttpFactoryArgs <List <RecommandNav> > args) { _coverChannelFactory = new CoverListFactory(); _coverChannelFactory.HttpSucessHandler += coverFactory_GetCoverInfosSuccess; if (_httpFailorTimeOut != null) { _coverChannelFactory.HttpFailorTimeOut = _httpFailorTimeOut; } if (args.Result.Count > 0) { var random = new Random(); var index = random.Next(0, args.Result.Count - 1); _coverChannelFactory.DownLoadDatas(args.Result[index].Navid); } }
void _hotSearchFactory_httpSucessHandler(object sender, HttpFactoryArgs<List<HotSearchInfo>> args) { if (args.Result == null || args.Result.Count <= 0) return; _hotSearchInfos = new List<HotSearchInfo>(); _hotSearchInfosByDisplay = new List<HotSearchInfo>(); for (int i = 0; i < (args.Result.Count >= 6 ? 6 : args.Result.Count); i++) { HotSearchInfo itemCopy = new HotSearchInfo(args.Result[i].Type, args.Result[i].Count.ToString(), args.Result[i].Key); _hotSearchInfos.Add(args.Result[i]); _hotSearchInfosByDisplay.Add(itemCopy); } SortByCharLenght(); InitElement(); }
void _playInfoFactory_GetPlayInfoSucceed(object sender, HttpFactoryArgs <PlayInfo> args) { _playInfo = args.Result; SetVarDefault(); BuildBitrates(); if (BeginPlay(-1, false)) { xPlayerControlBar.ChannelDetailInfo = ChannelDetailInfo; } else { SetInfo(false, "", false); MessageBox.Show("不能播放该影片"); } }
void coverFactory_GetCoverInfosSuccess(object sender, HttpFactoryArgs <List <CoverInfo> > args) { var random = new Random(); if (args.Result.Count > 0) { for (var i = 0; i < args.Result.Count && i < 4; i++) { TileUtils.CreateLocalNotifications(args.Result[i]); } _covers = args.Result; Calculate(_covers.Count); InitElements(); } }
void liveCenter_HttpSucessed(object sender, HttpFactoryArgs <LiveArgs> e) { var group = CreateGroup(e.Result.GroupName); _liveCenterViewModel.Add(group); CreateItems(group, e.Result.Channels); if (_groupIndex == 3 && _scrollOffset != 0) { rootScroolViewer.ScrollToHorizontalOffset(_scrollOffset); _scrollOffset = 0; } CloseTips(); GetLiveList(); }
private void channelDetailFactory_Successed(object sender, HttpFactoryArgs<ChannelDetailInfo> e) { _dataSource = e.Result; if (_dataSource.ProgramInfos == null) { TileUtils.CreateToastNotifications("该节目信息不存在!"); GoBack(this, new RoutedEventArgs()); return; } if (!_dataSource.IsNumber && _dataSource.ProgramInfos.Count == 1) _dataSource.ProgramInfos[0].Title = string.Format("{0} 全一集", _dataSource.ProgramInfos[0].Title); imgOrder.Visibility = e.Result.ProgramInfos.Count == 1 ? Visibility.Collapsed : Visibility.Visible; DataContext = _dataSource; channelListView.ItemsSource = _dataSource.ProgramInfos; ShareUtils.ShareInfo = new PlayShareInfo (_dataSource.Id, _dataSource.Title, _dataSource.ImageUri); CloseWaitToolTips(); }
private void LoginFactory_Sucess(object sender, HttpFactoryArgs<UserStateInfo> e) { loadingTip.Visibility = Visibility.Collapsed; var userInfo = e.Result; if (userInfo.UserState == 0) { var personalInfo = new PersonalInfo(); personalInfo.IsSaveInfo = toggleUserInfo.IsChecked.Value; personalInfo.IsAutoLogin = toggleAutoLogin.IsChecked.Value; personalInfo.UserPassWord = PPTVData.Utils.DataCommonUtils.Encode(txtPassWord.Password, Utils.Constants.PasswordKey); personalInfo.UserStateInfo = e.Result; personalInfo.IsCurrentLogin = true; PersonalFactory.Instance.InsertRecord(personalInfo); if (NavigationService.CanGoBack) NavigationService.GoBack(); if (LoginSucessHandler != null) LoginSucessHandler(); } else { var response = string.Empty; switch (userInfo.UserState) { case 1: response = "该用户名不存在"; break; case 2: response = "密码错误"; break; case 3: response = "该用户已锁定"; break; case 4: response = "该用户已过期"; break; case 5: response = "该用户已删除"; break; default: response = "登录失败"; break; } TileUtils.CreateBasicToast(response); } }
private void LoginFactory_Sucess(object sender, HttpFactoryArgs<UserStateInfo> e) { progressRing.Visibility = Visibility.Collapsed; var userInfo = e.Result; if (userInfo.UserState == 0) { var personalInfo = new PersonalInfo(); personalInfo.IsSaveInfo = ToggleUserInfo.IsOn; personalInfo.IsAutoLogin = ToggleAutoLogin.IsOn; personalInfo.UserPassWord = PPTVData.Utils.DataCommonUtils.Encode(TxtPassWord.Password, Utils.Constants.PasswordKey); personalInfo.UserStateInfo = e.Result; PersonalFactory.Instance.InsertRecord(personalInfo); Popup.IsOpen = false; if (LoginSucessHandler != null) LoginSucessHandler(this, new RoutedEventArgs()); } else { var response = string.Empty; switch (userInfo.UserState) { case 1: response = "该用户名不存在"; break; case 2: response = "密码错误"; break; case 3: response = "该用户已锁定"; break; case 4: response = "该用户已过期"; break; case 5: response = "该用户已删除"; break; default: response = "登录失败"; break; } TileUtils.CreateToastNotifications(response); } }
private void playFac_GetPlayInfoFailed(object sender, HttpFactoryArgs<PPTVData.Entity.PlayInfo> args) { foreach (DownInfo info in MyDownloading) { if (info.VID == _vid) { info.StatusImage = "/PPTVForWP7;component/Images/png.png"; break; } } }
void _loginFactory_GetUserInfoFailed(object sender, HttpFactoryArgs<UserStateInfo> args) { if (_isBack) { if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } else { LoadingWait.Visibility = Visibility.Collapsed; } }
void _loginFactory_GetUserInfoSuccess(object sender, HttpFactoryArgs< UserStateInfo> args) { LoadingWait.Visibility = Visibility.Collapsed; var userStateInfo = args.Result; if (userStateInfo.UserState == 0) { //成功 Utils.Utils._userStateInfo = userStateInfo; Utils.Utils._isValidatedFromServer = true; if (_isBack) { if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } else NavigationService.Navigate(new Uri("/PersonalInfo.xaml?validation=true", UriKind.RelativeOrAbsolute)); if (xRembPass.IsChecked.Value) { Utils.Utils.SetUserNaToIOS(userStateInfo.UserName); Utils.Utils.SetUserpdToIOS(_password); Utils.Utils.SetUserInfoSaveSwitchToIOS(true); } else Utils.Utils.SetUserInfoSaveSwitchToIOS(false); if (xAutoLogon.IsChecked.Value) Utils.Utils.SetAutoLoginToIOS(true); else Utils.Utils.SetAutoLoginToIOS(false); } else { //不成功 Utils.Utils._isValidatedFromServer = false; Utils.Utils._userStateInfo = null; Utils.Utils.SetUserNaToIOS(string.Empty); Utils.Utils.SetUserpdToIOS(string.Empty); Utils.Utils.SetAutoLoginToIOS(false); Utils.Utils.SetUserInfoSaveSwitchToIOS(false); string result = ""; switch (userStateInfo.UserState) { case 1: result = "用户不存在"; break; case 2: result = "密码错误"; break; case 3: result = "该用户已锁定"; break; case 4: result = "该用户已过期"; break; case 5: result = "该用户已删除"; break; default: result = "登录失败"; break; } MessageBox.Show(result); if (_isBack) { if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } } }
void _tagFactoryOfCatalog_GetTagsFailed(object sender, HttpFactoryArgs<TagFactoryInfo> args) { xCatalogProgressBar.Visibility = Visibility.Collapsed; if (DataDownloadFailed != null) DataDownloadFailed(sender, null); }
void _tagFactoryOfCatalog_GetTagsSucceed(object sender, HttpFactoryArgs<TagFactoryInfo> args) { LogManager.Ins.Log("下载守Catalog数据Tag"); SetDownloadStatus(false); _tagInfosOfCatalog = args.Result.Tags; InitElement(xCatalogListBox, _tagInfosOfCatalog); }
void _tagFactoryOfArea_GetTagsSucceed(object sender, HttpFactoryArgs<TagFactoryInfo> args) { LogManager.Ins.Log("下载守Aear数据Tag"); SetDownloadStatus(false); _tagInfosOfArea = args.Result.Tags; InitElement(xAreaListBox, _tagInfosOfArea); }
void _recommendNavFactory_GetRecommendNavFailed(object sender, HttpFactoryArgs<List<RecommendNav>> args) { }
void recommendChannelFactory_GetChannelsSucceed(object sender, HttpFactoryArgs<VodChannelListInfo> e) { loadingTip.Visibility = Visibility.Collapsed; _maxPage = e.Result.PageCount; ChannelRecommendGroup group = null; for (int i = 0; i < e.Result.Channels.Count; i++) { if (i % _groupNum == 0) { group = new ChannelRecommendGroup(); group.ItemsGroup = new ObservableCollection<ChannelRecommendListItem>(); _recommendViewModel.Groups.Add(group); } group.ItemsGroup.Add(new ChannelRecommendListItem { ChannelId = e.Result.Channels[i].Id, ChannelFlag = e.Result.Channels[i].ChannelFlag, Mark = e.Result.Channels[i].Mark, ImageUri = e.Result.Channels[i].ImageUri, Title = e.Result.Channels[i].Title, Act = e.Result.Channels[i].Act, Duration = e.Result.Channels[i].Duration }); } }
void recommandNav_Successed(object sender, HttpFactoryArgs<List<RecommandNav>> args) { RecommandNavs = args.Result.Take(5).ToList(); if (RecommandNavs.Count > 0) { _currentRecIndex = 0; _recommendChannelFactory = new RecommendListFactory(); _recommendChannelFactory.HttpSucessHandler += recommandChannelFactory_GetChannelsSucceed; _recommendChannelFactory.HttpFailorTimeOut += http_FailorTimeOut; getRecommand(); } }
private void typeFactory_HttpSucess(object sender, HttpFactoryArgs<List<TypeInfo>> args) { var selectGroup = new ChannelTypeGroup(); selectGroup.GroupName = "已固定"; selectGroup.ItemsGroup = new ObservableCollection<ChannelTypeItem>(); var unSelectGroup = new ChannelTypeGroup(); unSelectGroup.GroupName = "未固定"; unSelectGroup.ItemsGroup = new ObservableCollection<ChannelTypeItem>(); _allViewModel.Groups.Add(selectGroup); _allViewModel.Groups.Add(unSelectGroup); var roamingValue = DataStoreUtils.GetRoamingSettingValue(_channelTypeSettingKey) as string; if (string.IsNullOrEmpty(roamingValue)) roamingValue = string.Join("/", args.Result.Take(ColNumber * 2).Select(v => v.TypeId.ToString())); var firstLaunch = DataStoreUtils.GetLocalSettingValue(_channelTypeSettingKey) as string; if (string.IsNullOrEmpty(firstLaunch)) { if (!roamingValue.Contains("75099")) { roamingValue = roamingValue.Insert(0, "75099/"); roamingValue = roamingValue.Remove(roamingValue.LastIndexOf('/')); } if (!roamingValue.Contains(LiveTypeId.ToString())) { roamingValue = roamingValue.Insert(0, string.Format("{0}/", LiveTypeId.ToString())); roamingValue = roamingValue.Remove(roamingValue.LastIndexOf('/')); } DataStoreUtils.AddLocalSettingValue(_channelTypeSettingKey, "1"); DataStoreUtils.AddRoamingSettingValue(_channelTypeSettingKey, roamingValue); } _isReorder = false; var selectValues = roamingValue.Split('/'); foreach (var type in args.Result) { ProcessViewModel(selectValues, type.TypeId, type.Name); } foreach (var type in _localTypes) { ProcessViewModel(selectValues, type.TypeId, type.TypeName); } foreach(var selected in selectValues) { var item = _allViewModel.Groups[0].ItemsGroup.FirstOrDefault(v => v.TypeId == Convert.ToInt32(selected)); if (item != null) { _selectedViewModel.Add(item); } } }
private void loginFactory_HttpSurcess(object sender, HttpFactoryArgs<UserStateInfo> e) { if (e.Result.UserState == 0) { var personInfo = PersonalFactory.Instance.DataInfos[0]; personInfo.UserStateInfo = e.Result; PersonalFactory.Instance.SubmitChange(); } }
private void OnGetChannelsBySearchTimeout(object sender, HttpFactoryArgs<VodChannelListInfo> args) { LoadingWait.Visibility = Visibility.Collapsed; CommonUtils.HttpTimeOutWarn(); }
private void wayGetFactory_HttpSucess(object sender, HttpFactoryArgs<WAYGetInfo> e) { WAYGetFactory.WayGetInfo = e.Result; }
void playFac_GetPlayInfoSucceed(object sender, HttpFactoryArgs<PPTVData.Entity.PlayInfo> args) { PPTVData.Entity.PlayInfo.Item item = args.Result.GetItemByFileType(5); if (item == null) return; _rid = item.Rid; if (item.DtInfo != null) { DownPage.UpdateTask(_vid, item.url); } else { string jump_url = "http://wp7.jump.synacast.com/" + item.Rid + "dt?type=mwp7"; PPTVData.HttpWebClient jumpWebClient = new PPTVData.HttpWebClient(); jumpWebClient.DownloadStringCompleted += new PPTVData.DownloadStringCompletedEventHandler(JumpWebClientDownloadStringCompleted); jumpWebClient.DownloadStringAsync(jump_url); } }
void coverFactory_GetCoverInfosSuccess(object sender, HttpFactoryArgs<List<CoverInfo>> args) { var random = new Random(); if (args.Result.Count > 0) { _covers = args.Result; Calculate(_covers.Count); InitElements(); } }
void _tagFactoryOfCatalog_GetTagsTimeout(object sender, HttpFactoryArgs<TagFactoryInfo> args) { xCatalogProgressBar.Visibility = Visibility.Collapsed; }
void _channelDetailFactory_HttpSucceed(object sender, HttpFactoryArgs<ChannelDetailInfo> args) { _playInfo.UpdateChannelDetailInfo(args.Result); BeginGetPlayInfo(); }
void cloudRecentGetFactory_HttpSucess(object sender, HttpFactoryArgs<CloudArgs> args) { LocalRecentFactory.Instance.InsertCloudRecords(args.Result.Datas); }
void recommandChannelFactory_GetChannelsSucceed(object sender, HttpFactoryArgs<VodChannelListInfo> args) { if (args.Result.Channels.Count <= 0) { _currentRecIndex++; return; } var count = args.Result.Channels.Count; if (count < _recCount) count = Convert.ToInt32(Math.Ceiling(count / 3.0) * 3); for (var i = 0; i < count; i++) { ChannelRecommendListItem dataItem = null; if (i < args.Result.Channels.Count) dataItem = new ChannelRecommendListItem() { Index = i == 0 ? _currentRecIndex + 1 : -1, GruopName = RecommandNavs[_currentRecIndex].Name, GroupCount = args.Result.ChannelCount, ChannelId = args.Result.Channels[i].Id, ChannelFlag = args.Result.Channels[i].ChannelFlag, ImageUri = args.Result.Channels[i].ImageUri, Title = args.Result.Channels[i].Title, Mark = args.Result.Channels[i].Mark }; else dataItem = new ChannelRecommendListItem { Index = -2 }; _recommendChannelViewModel.Add(dataItem); } _currentRecIndex++; if (_currentRecIndex < RecommandNavs.Count) getRecommand(); else loadingTip.Visibility = Visibility.Collapsed; }
void _playInfoFactory_HttpSucceed(object sender, HttpFactoryArgs<Object> args) { _playMessage.PlayInfos = _playInfoFactory.PlayInfos; _playMessage.HasPreProgram = ChannelUtils.CreatePreviousIndex(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo) >= 0 ? true : false; _playMessage.HasNextProgram = ChannelUtils.CreateNextIndex(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo) >= 0 ? true : false; _playMessage.ShareInfo = new PlayShareInfo( ChannelUtils.CreateChannelId(_playInfo.ProgramIndex, _playInfo.ChannelDetailInfo), _playMessage.Title, _playInfo.ChannelDetailInfo.ImageUri); var info = _playInfoFactory.CreatePlayInfo(_playFileType); if (info != null) { _playMessage.CurrentPlayInfo = info; Play(info); if (PlayMessageAction != null) PlayMessageAction(_playMessage); } else { if (PlayErrorAction != null) PlayErrorAction("无法获取影片播放地址"); } }
void cloudFavolitenGetFactory_HttpSucess(object sender, HttpFactoryArgs<CloudArgs> args) { LocalFavoritesFactory.Instance.InsertCloudRecords(args.Result.Datas); }
void _recommendNavFactory_GetRecommendNavSucceed(object sender, HttpFactoryArgs<List<RecommendNav>> args) { _recommendNavs = args.Result; InitElement(); }