private void DestroyBasic() { try { RewardedVideo?.Destroy(); MAdapter = null; ImageUser = null; ImageBlog = null; MRecycler = null; TxtUsername = null; TxtTime = null; TxtTitle = null; TxtViews = null; TxtHtml = null; BtnMore = null; ArticleData = null; MAdapter = null; MRecycler = null; TxtComment = null; ArticlesId = null; Instance = null; ReplyFragment = null; DataWebHtml = null; RewardedVideo = null; } catch (Exception e) { Console.WriteLine(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (TypeDialog == "DeleteComment") { if (p1 == DialogAction.Positive) { MainContext.RunOnUiThread(() => { try { if (TypeClass == "Comment") { //TypeClass var adapterGlobal = ArticlesViewActivity.GetInstance()?.MAdapter; var dataGlobal = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id); if (dataGlobal != null) { var index = adapterGlobal.CommentList.IndexOf(dataGlobal); if (index > -1) { adapterGlobal.CommentList.RemoveAt(index); adapterGlobal.NotifyItemRemoved(index); } } if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } else { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Article.DeleteCommentAsync(CommentObject.BlogId, CommentObject.Id) }); } } else if (TypeClass == "Reply") { //TypeClass var adapterGlobal = ArticlesViewActivity.GetInstance()?.ReplyFragment?.MAdapterArticles; var dataGlobal = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id); if (dataGlobal != null) { var index = adapterGlobal.CommentList.IndexOf(dataGlobal); if (index > -1) { adapterGlobal.CommentList.RemoveAt(index); adapterGlobal.NotifyItemRemoved(index); } } if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } else { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Article.DeleteCommentAsync(CommentObject.BlogId, CommentObject.Id, "reply_delete") }); } } Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CommentSuccessfullyDeleted), ToastLength.Short).Show(); } catch (Exception e) { Console.WriteLine(e); } }); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } else { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } } catch (Exception e) { Console.WriteLine(e); } }