Beispiel #1
0
        /// <summary>
        /// 请求输入;
        /// </summary>
        /// <param name="title">对话框标题</param>
        /// <param name="des">对话框内容</param>
        /// <returns></returns>
        public static string Show(GetInputValueSetting setting = null)
        {
            var vm = new InputValueWindowViewModel(setting?.InputChecker)
            {
                Title = setting?.Title,
                Val   = setting?.Val,
                Desc  = setting?.Desc
            };


            var window = new InputValueWindow {
                DataContext = vm
            };

            vm.ClosedRequest += delegate { window.Close(); };

            window.ShowDialog(setting.Owner);

            if (vm.Confirmed)
            {
                return(vm.Val);
            }

            return(null);
        }
Beispiel #2
0
 private void btnLockPlayer_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (this.datagridPlayerInfos.SelectedItem is PlayerInfoUIModel)
         {
             PlayerInfoUIModel player = this.datagridPlayerInfos.SelectedItem as PlayerInfoUIModel;
             if (player.IsLocked)
             {
                 MyMessageBox.ShowInfo("该玩家已经被锁定");
                 return;
             }
             InputActionPasswordWindow win = new InputActionPasswordWindow();
             if (win.ShowDialog() == true)
             {
                 string           ActionPassword = win.ActionPassword;
                 InputValueWindow winInputValue  = new InputValueWindow("请确认", "请输入要锁定玩家登录天数", 100, 1);
                 if (winInputValue.ShowDialog() == true)
                 {
                     App.PlayerVMObject.AsyncLockPlayerInfos(player.UserLoginName, ActionPassword, (int)winInputValue.Value);
                 }
             }
         }
     }
     catch (Exception exc)
     {
         MyMessageBox.ShowInfo("锁定玩家异常。" + exc.Message);
     }
 }