public void Test_DblInput() { double val; ModalFormHandler = InputBox_btnAccept_DblHandler; GKInputBox.QueryDouble("caption", "prompt", out val); Assert.AreEqual(15.59, val); }
public void Test_IntInput() { int intValue; ModalFormHandler = InputBox_btnAccept_IntHandler; GKInputBox.QueryInt("caption", "prompt", out intValue); Assert.AreEqual(123, intValue); }
public void Test_PwInput() { string strValue = ""; ModalFormHandler = InputBox_btnAccept_StrHandler; GKInputBox.QueryPassword("caption", "prompt", ref strValue); Assert.AreEqual("input", strValue); }
public void Test_StrInput() { string strValue = "test"; ModalFormHandler = InputBox_btnAccept_StrHandler; GKInputBox.QueryText(null, "caption", "prompt", ref strValue); Assert.AreEqual("input", strValue); }
public static bool QueryText(object owner, string caption, string prompt, ref string value) { bool result = false; using (var inputBox = new GKInputBox(caption, prompt, value, NumbersMode.nmNone)) { if (inputBox.ShowModal((Control)owner) == DialogResult.Ok) { value = inputBox.Value.Trim(); result = true; } } return(result); }
public static bool QueryPassword(string caption, string prompt, ref string value) { bool result = false; using (var inputBox = new GKInputBox(caption, prompt, value, NumbersMode.nmNone, true)) { if (inputBox.ShowModal() == DialogResult.Ok) { value = inputBox.Value.Trim(); result = true; } } return(result); }
public static bool QueryInt(string caption, string prompt, out int value) { bool result = false; value = 0; using (var inputBox = new GKInputBox(caption, prompt, value.ToString(), NumbersMode.nmInt)) { if (inputBox.ShowModal() == DialogResult.Ok) { result = int.TryParse(inputBox.Value, out value); } } return(result); }
public static bool QueryDouble(string caption, string prompt, out double value) { bool result = false; value = 0.0; using (var inputBox = new GKInputBox(caption, prompt, value.ToString(), NumbersMode.nmFloat)) { if (inputBox.ShowDialog() == DialogResult.OK) { result = double.TryParse(inputBox.Value, out value); } } return(result); }
public bool GetPassword(string prompt, ref string value) { bool res = GKInputBox.QueryPassword(GKData.APP_TITLE, prompt, ref value); return(res && !string.IsNullOrEmpty(value)); }