async void DoSelectLOCommand(lo_by_circle_wrapper learningobj) { try { CurrentLOIDSelected = learningobj.lo.id; LoadLOComments(CurrentLOIDSelected); FilterQuizzes(CurrentLOIDSelected); // //reset the value of background image BackgroundImage = learningobj.background_bytes; } catch (WebException e) { ConnectionOK = false; } catch (HttpRequestException e) { ConnectionOK = false; } catch (MobileServiceInvalidOperationException e) { Mvx.Trace("MobileServiceInvalidOperationException " + e.Message); OperationOK = false; } }
async void DoOpenFirstSlidePage(lo_by_circle_wrapper learningobj) { //await _mLearningService.OpenLearningObject(learningobj.lo.id,learningobj.lo.url_package,UserID); try { //Download all the data of the selected LO foreach (var item in LearningOjectsList) { if (item.lo.id == learningobj.lo.id) { var list = await _mLearningService.GetPagesByLO(learningobj.lo.id); //Page result = await this._mLearningService.GetFirstSlidePageByLOSection(item.lo.id); if (list != null) { Debug.WriteLine("indexList", "result...: " + list.Count); /** Problema: Datos no Ordenados por ID * Solucion: Usar in SortedDictionary * */ var indexTmp = new SortedDictionary <int, IList <Page> > (); foreach (var page in list) { IList <Page> resultTmp; if (!indexTmp.TryGetValue((int)page.LOsection_id, out resultTmp)) { var ls = new List <Page>(); ls.Add(page); indexTmp [(int)page.LOsection_id] = ls; } else { resultTmp.Add(page); } } ContentByUnit = new ObservableDictionary <int, IList <Page> >(indexTmp); } } } } catch (WebException e) { ConnectionOK = false; } catch (HttpRequestException e) { ConnectionOK = false; } catch (MobileServiceInvalidOperationException e) { Mvx.Trace("MobileServiceInvalidOperationException " + e.Message); OperationOK = false; } }
async void DoOpenLOMapCommand(lo_by_circle_wrapper learningobj) { //await _mLearningService.OpenLearningObject(learningobj.lo.id,learningobj.lo.url_package,UserID); try { List <lo_by_circle> list = LearningOjectsList.Select(lo => lo.lo).ToList(); //await BlockDownload.TryLoadByteVector<MLearning.Core.ViewModels.MainViewModel.lo_by_circle_wrapper>(LearningOjectsList.ToList(), // (pos, bytes) => { }, // (lo) => { return lo.lo.url_background; } // ); //Download all the data of the selected LO /*foreach (var item in LearningOjectsList) * { * if (item.lo.id == learningobj.lo.id) * { * await FetchLOData(item.lo.id, true); * } * else * { * await FetchLOData(item.lo.id, false); * } * * * * }*/ string serialized = JsonConvert.SerializeObject(list); ShowViewModel <LOMapViewModel>(new { lo_id = learningobj.lo.id, serialized_los_in_circle = serialized, _currentCurso = this._currentCurso, _currentUnidad = this._currentUnidad, _currentSection = this._currentSection }); } catch (WebException e) { ConnectionOK = false; } catch (HttpRequestException e) { ConnectionOK = false; } catch (MobileServiceInvalidOperationException e) { Mvx.Trace("MobileServiceInvalidOperationException " + e.Message); OperationOK = false; } }
async void DoOpenLOSectionListCommandCommand(lo_by_circle_wrapper learningobj) { var listas = await _mLearningService.GetSectionsByLO(learningobj.lo.id); if (listas != null) { //NewsCollection=new ObservableCollection<string>(await service.LoadNews ()); this.LOsectionList = new ObservableCollection <LOsection>(listas); } }
void DoLikeLOCommand(lo_by_circle_wrapper learningobj) { _mLearningService.LikeOrDislikeLO(learningobj.lo.id, UserID); }
void DoLikeLOCommand(lo_by_circle_wrapper learningobj) { _mLearningService.LikeOrDislikeLO(learningobj.lo.id,UserID); }
async void DoOpenLOCommand(lo_by_circle_wrapper learningobj) { //await _mLearningService.OpenLearningObject(learningobj.lo.id,learningobj.lo.url_package,UserID); try { List<lo_by_circle> list = LearningOjectsList.Select(lo => lo.lo).ToList(); //await BlockDownload.TryLoadByteVector<MLearning.Core.ViewModels.MainViewModel.lo_by_circle_wrapper>(LearningOjectsList.ToList(), // (pos, bytes) => { }, // (lo) => { return lo.lo.url_background; } // ); //Download all the data of the selected LO foreach (var item in LearningOjectsList) { if (item.lo.id == learningobj.lo.id) { await FetchLOData(item.lo.id, true); } else { await FetchLOData(item.lo.id, false); } } string serialized = JsonConvert.SerializeObject(list); ShowViewModel<LOViewModel>(new { lo_id = learningobj.lo.id, serialized_los_in_circle = serialized }); } catch (WebException e) { ConnectionOK = false; } catch (HttpRequestException e) { ConnectionOK = false; } catch (MobileServiceInvalidOperationException e) { Mvx.Trace("MobileServiceInvalidOperationException " + e.Message); OperationOK = false; } }