コード例 #1
0
        protected void CreateOrEditPost(bool skipPlagiarismCheck)
        {
            var pushToBlockchainRetry = false;

            do
            {
                if (!skipPlagiarismCheck)
                {
                    var plagiarismCheck = _presenter.TryCheckForPlagiarism(model).Result;
                    if (plagiarismCheck.IsSuccess)
                    {
                        if (plagiarismCheck.Result.plagiarism.IsPlagiarism)
                        {
                            InvokeOnMainThread(() =>
                            {
                                plagiarismResult             = new PlagiarismResult();
                                var plagiarismViewController = new PlagiarismViewController(ImageAssets, plagiarismCheck.Result.plagiarism, plagiarismResult);
                                NavigationController.PushViewController(plagiarismViewController, true);
                            });

                            return;
                        }
                    }
                }

                pushToBlockchainRetry = false;
                var response = _presenter.TryCreateOrEditPost(model).Result;
                if (!(response != null && response.IsSuccess))
                {
                    InvokeOnMainThread(() =>
                    {
                        ShowDialog(response.Exception, LocalizationKeys.Cancel, LocalizationKeys.Retry,
                                   (arg) => { mre.Set(); }, (arg) =>
                        {
                            pushToBlockchainRetry = true;
                            mre.Set();
                        });
                    });

                    mre.Reset();
                    mre.WaitOne();
                }
                else
                {
                    InvokeOnMainThread(() =>
                    {
                        ShouldProfileUpdate = true;
                        NavigationController.ViewControllers = new UIViewController[]
                        { NavigationController.ViewControllers[0], this };
                        NavigationController.PopViewController(false);
                    });
                }
            } while (pushToBlockchainRetry);
        }
コード例 #2
0
 public PlagiarismViewController(List <Tuple <NSDictionary, UIImage> > assets, Plagiarism model, PlagiarismResult plagiarismResult = null)
 {
     ImageAssets           = assets;
     _model                = model;
     this.plagiarismResult = plagiarismResult;
 }