コード例 #1
0
ファイル: UserReviewTest.cs プロジェクト: kauke88/StudyBuddy
        private void button1_Click_1(object sender, EventArgs e)
        {
            var mngr = new UserReviewManager(localUser);

            mngr.PostUserReviewResult += (status, review) =>
            {
                this.Invoke((MethodInvoker) delegate
                {
                    if (status == UserReviewManager.ManagerStatus.Success)
                    {
                        Console.WriteLine("success in posting");
                    }
                    else
                    {
                        Console.WriteLine("failure in posting");
                    }
                });
            };
            mngr.postReview(new UserReview {
                Username = "******", Message = "Asfsfs", Karma = 1
            });
        }
コード例 #2
0
        private void sendingReview(UserReview userReview)
        {
            var mngr = new UserReviewManager(localUser);

            mngr.PostUserReviewResult += (status, review) =>
            {
                this.Invoke((MethodInvoker) delegate
                {
                    if (status == UserReviewManager.ManagerStatus.Success)
                    {
                        //Console.WriteLine("success in posting");
                        messageToUser.Text = "Atsiliepimas išsiųstas";
                    }
                    else
                    {
                        //Console.WriteLine("failure in posting");
                        messageToUser.Text = "Atsiliepimas neišsiųstas";
                    }
                });
            };
            mngr.postReview(userReview);
        }