public static PagedResult <CommentEntryDTO> GetComments(IRatingable ratingable, PartialRetrievingInfo retrievingInfo) { return(exceptionHandling(delegate { retrievingInfo.PageSize = GetPageSize(retrievingInfo.PageSize); return Instance.GetComments(Token, ratingable.GlobalId, retrievingInfo); })); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); //this.RestoreState(); StateHelper helper = new StateHelper(State); Item = helper.GetValue("Exercise", Item); DataContext = new VotingViewModel(Item); }
public void Restore(System.Collections.Generic.IDictionary <string, object> state) { if (state.ContainsKey("PageComments")) { Comments = state["PageComments"] as ObservableCollection <VoteViewModel>; result = state["PageResult"] as PagedResultOfCommentEntryDTO5oAtqRlh; loaded = (bool)state["Loaded"]; entry = (IRatingable)state["Entry"]; updateNoRatingsLabel(); } //setCommentsStatus(); }
public void Fill(IRatingable ratingable, bool cannotVote, string cannotVoteMessage) { this.ratingable = ratingable; if (ratingable != null) { rbGlobalRating.Rate = ratingable.Rating; rbUserRating.Rate = ratingable.UserRating.HasValue ? ratingable.UserRating.Value : 0.0f; txtShortComment.Text = ratingable.UserShortComment; } CannotVote = cannotVote; CannotVoteMessage = cannotVoteMessage; updateGui(false); }
public void Load(IRatingable exercise) { entry = exercise; var m = new ServiceManager <GetCommentsCompletedEventArgs>(delegate(BodyArchitectAccessServiceClient client1, EventHandler <GetCommentsCompletedEventArgs> operationCompleted) { client1.GetCommentsCompleted -= operationCompleted; client1.GetCommentsCompleted += operationCompleted; client1.GetCommentsAsync(ApplicationState.Current.SessionData.Token, entry.GlobalId, new PartialRetrievingInfo()); }); m.OperationCompleted += (s, a) => { refreshRequired = false; if (a.Error != null) { onCommentsLoaded(); BAMessageBox.ShowError(ApplicationStrings.VotesControl_ErrRetrieveRatings); return; } else { Comments.Clear(); result = a.Result.Result; foreach (var item in a.Result.Result.Items) { Comments.Add(new VoteViewModel(item)); } updateNoRatingsLabel(); loaded = true; //setCommentsStatus(); } onCommentsLoaded(); }; if (!m.Run()) { onCommentsLoaded(); if (ApplicationState.Current.IsOffline) { BAMessageBox.ShowError(ApplicationStrings.ErrOfflineMode); } else { BAMessageBox.ShowError(ApplicationStrings.ErrNoNetwork); } } }
public VoteEventArgs(IRatingable ratingable) { this.ratingable = ratingable; }
public override void Fill(IRatingable plan) { base.Fill(plan); usrRating1.Fill(plan, CannotVote, CannotVoteMessage); fillCommentsList(); }
public virtual void Fill(IRatingable plan) { this.plan = plan; }
public VotingViewModel(IRatingable exercise) { this.exercise = exercise; }
public VoteEventArgs(RoutedEvent routedEvent, object source, IRatingable ratingable) : base(routedEvent, source) { this.ratingable = ratingable; }
public void Fill(IRatingable plan) { this.plan = plan; usrRating1.Fill(plan, CannotVote, CannotVoteMessage); fillCommentsList(); }