protected virtual void OnLostFocus()
 {
     result = WindowResult.LostFocus;
     
     if (owner != null)
         owner.ModalClosed(this);
 }
 protected virtual void Cancel()
 {
     result = WindowResult.Cancel;
     
     if (owner != null)
         owner.ModalClosed(this);
     
     Close();
 }
 protected virtual void Ok()
 {
     result = WindowResult.Ok;
     
     if (owner != null)
         owner.ModalClosed(this);
     
     Close();
 }
 public void Close(WindowResult windowResult = WindowResult.None)
 {
     UIManager.Instance.Close(this.Type);
     if (this.Onclose != null)
     {
         Onclose.Invoke(this, windowResult);
     }
     Onclose = null;
 }
示例#5
0
 public void Close(WindowResult result = WindowResult.None)
 {
     UIManager.Instance.Close(this.Type);
     if (this.OnClose != null)
     {
         this.OnClose(this, result);
     }
     this.OnClose = null;
 }
示例#6
0
        protected virtual void OnLostFocus()
        {
            result = WindowResult.LostFocus;

            if (owner != null)
            {
                owner.ModalClosed(this);
            }
        }
        protected virtual void OnLostFocus()
        {
            _result = WindowResult.LostFocus;

            if (Del != null)
            {
                Del(this);
            }
        }
示例#8
0
文件: UIWindow.cs 项目: Lenzan/newmmo
 public void Close(WindowResult result = WindowResult.None)
 {
     SoundManager.Instance.PlaySound(SoundDefine.SFX_UI_Win_Close);
     UIManager.Instance.Close(this.Type);
     if (this.OnClose != null)
     {
         this.OnClose(this, result);
     }
     this.OnClose = null;
 }
        protected virtual void Ok()
        {
            _result = WindowResult.Ok;

            if (Del != null)
            {
                Del(this);
            }
            Close();
        }
示例#10
0
        protected virtual void Cancel()
        {
            _result = WindowResult.Cancel;

            if (Del != null)
            {
                Del(this);
            }
            Close();
        }
示例#11
0
        protected virtual void Ok()
        {
            result = WindowResult.Ok;

            if (owner != null)
            {
                owner.ModalClosed(this);
            }

            Close();
        }
示例#12
0
        protected virtual void Cancel()
        {
            result = WindowResult.Cancel;

            if (owner != null)
            {
                owner.ModalClosed(this);
            }

            Close();
        }
示例#13
0
    protected void Close(WindowResult result = WindowResult.None)
    {
        Managers.UiManager.Instance.Close(Type);
        if (OnClose != null)
        {
            OnClose(this, result);
        }

        this.OnClose = null;
        compontCache?.Clear();
    }
示例#14
0
        protected virtual void _Ok()
        {
            _result = WindowResult.Ok;

            if (_owner != null)
            {
                _owner._ModalClosed(this);
            }

            Close();
        }
 private void PopNoGuild_OnClose(UIWindow sender, WindowResult windowResult)
 {
     //如果点击了创建公会
     if (windowResult == WindowResult.Yes)
     {
         UIManager.Instance.Show <UIGuildPopCreate>();
     }
     else if (windowResult == WindowResult.No)
     {
         UIManager.Instance.Show <UIGuildList>();
     }
 }
示例#16
0
        /// <summary>
        /// Creates the menu item.
        /// </summary>
        /// <param name="windowResult">The window result.</param>
        /// <param name="createTagData">The create tag data.</param>
        /// <param name="addTagAction">The add tag action.</param>
        public void CreateTagItem(WindowResult windowResult, CreateTagData createTagData, Action <string> addTagAction)
        {
            if (createTagData == null || string.IsNullOrEmpty(createTagData.Tags) || windowResult == WindowResult.Cancel || windowResult == WindowResult.Invalid)
            {
                Logger.Debug("Aborting tag creation");
                return;
            }

            foreach (string tag in createTagData.Tags.Split(' ', ',', ';'))
            {
                addTagAction(tag);
            }
        }
 public WindowResult ReceiveUserInput()
 {
     base.ShowDialog();
     var result = new WindowResult()
     {
         Type = this.IsCanceled ? WindowResultType.Canceled : WindowResultType.CommonFinished
     };
     if (result.Type == WindowResultType.CommonFinished)
     {
         result.Result = this.InputContent;
     }
     return result;
 }
示例#18
0
        /// <summary>
        /// Called when pressing Enter or Ok.
        /// </summary>
        protected virtual void Ok()
        {
            result = WindowResult.Ok;
            Event.current.Use();

            if (owner != null)
            {
                owner.ModalClosed(this);
            }

            Close();
            Remove();
        }
示例#19
0
        private void OnQuestDialogClose(UIWindow sender, WindowResult result)
        {
            UIQuestDialog dlg = (UIQuestDialog)sender;

            if (result == WindowResult.Yes) //接受任务 或提交
            {
                if (dlg.quest.Info == null) //提交
                {
                    QuestService.Instance.SendQuestAccpet(dlg.quest);
                }
                else//接受
                {
                    QuestService.Instance.SendQuestSubmit(dlg.quest);
                }
            }
            else if (result == WindowResult.No)//拒绝任务
            {
                MessageBox.Show(dlg.quest.Define.DialogDeny);
            }
        }
 private void OnOkClicked()
 {
     WindowResult.Invoke(true);
     Release();
 }
 internal WindowResult ReceiveUserSelect()
 {
     base.ShowDialog();
     var result = new WindowResult()
     {
         Type = this.IsCanceled ? WindowResultType.Canceled : WindowResultType.CommonFinished
     };
     if (result.Type == WindowResultType.CommonFinished)
     {
         result.Result = this.SelectItem;
     }
     return result;
 }
示例#22
0
        public void ShouldSetViewTypeToWindow()
        {
            var result = new WindowResult("MyWindow", null, new ViewEngineCollection());

            Assert.AreEqual("Window", result.Options["ViewType"]);
        }
示例#23
0
 /// <summary>
 /// Occurs when the window is about to close.
 /// </summary>
 protected virtual void OnClosed(WindowResult Result)
 {
     Closed?.Invoke(this, new EventArgs <WindowResult>(Result));
 }
示例#24
0
 private void OnUITestClose(UIWindow sender, WindowResult windowResult)
 {
     MessageBox.Show(string.Format("你点击了{0}", windowResult.ToString()), "确定");
 }
 private void OnCancelClicked()
 {
     WindowResult.Invoke(false);
     Release();
 }
示例#26
0
 /// <summary>
 /// Occurs when the window is about to close (async).
 /// </summary>
 protected virtual async Task OnBeginClosed(WindowResult Result)
 {
     await Task.Run(() => Closed?.Invoke(this, new EventArgs <WindowResult>(Result)));
 }