コード例 #1
0
 public static PagedResult <CommentEntryDTO> GetComments(IRatingable ratingable, PartialRetrievingInfo retrievingInfo)
 {
     return(exceptionHandling(delegate
     {
         retrievingInfo.PageSize = GetPageSize(retrievingInfo.PageSize);
         return Instance.GetComments(Token, ratingable.GlobalId, retrievingInfo);
     }));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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();
 }
コード例 #4
0
ファイル: usrRating.cs プロジェクト: robocik/BodyArchitect
 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);
 }
コード例 #5
0
        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);
                }
            }
        }
コード例 #6
0
ファイル: usrRating.cs プロジェクト: robocik/BodyArchitect
 public VoteEventArgs(IRatingable ratingable)
 {
     this.ratingable = ratingable;
 }
コード例 #7
0
 public override void Fill(IRatingable plan)
 {
     base.Fill(plan);
     usrRating1.Fill(plan, CannotVote, CannotVoteMessage);
     fillCommentsList();
 }
コード例 #8
0
 public virtual void Fill(IRatingable plan)
 {
     this.plan = plan;
 }
コード例 #9
0
 public VotingViewModel(IRatingable exercise)
 {
     this.exercise = exercise;
 }
コード例 #10
0
 public VoteEventArgs(RoutedEvent routedEvent, object source, IRatingable ratingable)
     : base(routedEvent, source)
 {
     this.ratingable = ratingable;
 }
コード例 #11
0
 public void Fill(IRatingable plan)
 {
     this.plan = plan;
     usrRating1.Fill(plan, CannotVote, CannotVoteMessage);
     fillCommentsList();
 }