Ejemplo n.º 1
0
        private void OnCancelClick()
        {
            if (Cancel != null)
            {
                DialogCancelArgs args = new DialogCancelArgs();
                Cancel(this, args);

                if (args.Cancel)
                {
                    return;
                }
            }

            if (CancelAction != null)
            {
                DialogCancelArgs args = new DialogCancelArgs();
                CancelAction(this, args);

                if (args.Cancel)
                {
                    return;
                }
            }


            Close();
        }
Ejemplo n.º 2
0
        private void OnOkClick()
        {
            if (Ok != null)
            {
                DialogCancelArgs args = new DialogCancelArgs();
                Ok(this, args);

                if (args.Cancel)
                {
                    return;
                }
            }

            if (OkAction != null)
            {
                DialogCancelArgs args = new DialogCancelArgs();
                OkAction(this, args);

                if (args.Cancel)
                {
                    return;
                }
            }

            Close();
        }
Ejemplo n.º 3
0
        public void Close(bool?result = null, bool raiseEvents = true, bool invokeActions = true)
        {
            if (m_parentRegion == null)
            {
                return;
            }


            if (result != null)
            {
                if (result == false)
                {
                    if (Cancel != null && raiseEvents)
                    {
                        DialogCancelArgs args = new DialogCancelArgs();
                        Cancel(this, args);
                        if (args.Cancel)
                        {
                            return;
                        }
                    }

                    if (CancelAction != null && invokeActions)
                    {
                        DialogCancelArgs args = new DialogCancelArgs();
                        CancelAction(this, args);
                        if (args.Cancel)
                        {
                            return;
                        }
                    }
                }
                else if (result == true)
                {
                    if (Ok != null && raiseEvents)
                    {
                        DialogCancelArgs args = new DialogCancelArgs();
                        Ok(this, args);
                        if (args.Cancel)
                        {
                            return;
                        }
                    }

                    if (OkAction != null && invokeActions)
                    {
                        DialogCancelArgs args = new DialogCancelArgs();
                        OkAction(this, args);
                        if (args.Cancel)
                        {
                            return;
                        }
                    }
                }
            }

            Destroy(m_parentRegion.gameObject);
            if (Closed != null)
            {
                Closed(this);
            }
        }