コード例 #1
0
        private void ObserveMeshPrep(RMModel model, MeshPreparationProgress progress)
        {
            // Success
            if (progress.PreparationDidSucceed)
            {
                var initProgress = FindViewById <RelativeLayout> (Resource.Id.relLayout1);
                RunOnUiThread(() => initProgress.Visibility = ViewStates.Gone);
            }

            // Still working
            if (!progress.PreparationDidSucceed && progress.FailException == null)
            {
                // can't really update the progress bar on Android :(
            }

            // Failure or Cancellation
            if (progress.FailException != null)
            {
                var progressBar = FindViewById <ProgressBar> (Resource.Id.ProgressBar01);
                RunOnUiThread(() => progressBar.Visibility = ViewStates.Invisible);

                var warningImage = FindViewById <ImageView> (Resource.Id.imageView1);
                RunOnUiThread(() => warningImage.Visibility = ViewStates.Visible);

                var initLabel = FindViewById <TextView> (Resource.Id.txtText);
                RunOnUiThread(() => initLabel.Text = progress.FailException.Message);
            }
        }
コード例 #2
0
        private void ObserveMeshPrep(RMModel model, MeshPreparationProgress progress)
        {
            // Success
            if (progress.PreparationDidSucceed)
            {
                InitPrepView.InvokeOnMainThread(delegate {
                    InitPrepView.Hidden = true;
                    SetupCamera();
                    EnableAllGestureRecognizers();
                    App.Manager.CurrentModel.MeshPrep -= new MeshPreparationHandler(ObserveMeshPrep);
                    PerformSelector(new Selector("RedrawDetailed"), null, 0.25);
                });
            }

            // Still working
            if (!progress.PreparationDidSucceed && progress.FailException == null)
            {
                ProgressBar.BeginInvokeOnMainThread(delegate {
                    ProgressBar.SetProgress((float)progress.MeshProgress, true);
                });
            }

            // Failure or Cancellation
            if (progress.FailException != null)
            {
                ProgressBar.BeginInvokeOnMainThread(delegate {
                    ProgressBar.Hidden = true;
                });

                WarningSymbol.BeginInvokeOnMainThread(delegate {
                    WarningSymbol.Hidden = false;
                });

                InitializingLabel.BeginInvokeOnMainThread(delegate {
                    InitializingLabel.Text = progress.FailException.Message;
                });
            }
        }