Beispiel #1
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;
                });
            }
        }