void AddCommentTapped()
        {
            var composer = new Composer();
            composer.NewComment(this, () =>
            {
                var comment = new CommentModel { Content = composer.Text };

                composer.DoWork(() =>
                {
                    Application.Client.Users[User].Repositories[Slug].Issues[Id].Comments.Create(comment);

                    InvokeOnMainThread(() =>
                    {
                        composer.CloseComposer();
                        _scrollToLastComment = true;
                        Model = null;
                        UpdateAndRender();
                    });
                }, ex =>
                {
                    Utilities.ShowAlert("Unable to post comment!", ex.Message);
                    composer.EnableSendButton = true;
                });
            });
        }
Esempio n. 2
0
 /// <summary>
 /// Updates a comment
 /// </summary>
 /// <param name="comment">The issue model</param>
 /// <returns></returns>
 public CommentModel Update(CommentModel comment)
 {
     return Update(ObjectToDictionaryConverter.Convert(comment));
 }