コード例 #1
0
        private void DismissComplete(bool cleanup)
        {
            this._IsVisible = false;

            this.TearDown();

            SetCurrentAlertView(null);

            SIAlertView nextAlertView = null;
            int         index         = SharedQueue.IndexOf(this);

            if (index > -1 && index < SharedQueue.Count() - 1)
            {
                nextAlertView = SharedQueue[index + 1];
            }

            if (cleanup)
            {
                SharedQueue.Remove(this);
            }

            SetAnimating(false);

            if (_IsVisible)
            {
                if (this.DidDismissHandler != null)
                {
                    this.DidDismissHandler.Invoke(this);
                }
                NSNotificationCenter.DefaultCenter.PostNotificationName(Constants.SIAlertViewDidDismissNotification, this, null);
            }

            // check if we should show next alert
            if (_IsVisible)
            {
                return;
            }

            if (nextAlertView != null)
            {
                nextAlertView.Show();
            }
            else
            {
                // show last alert view
                if (SharedQueue.Count > 0)
                {
                    SIAlertView alert = SharedQueue.Last();
                    alert.Show();
                }
            }
        }