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 }); }
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); }