//Syncronous method of CheckIfTextBoxIsEmptyAsync public static void CheckIfTextBoxIsEmptyNonAsync(string textBoxText, string textBox2Text, CheckPassword CheckForm, CheckPasswordBindingModel checkPasswordBindingModel) { if (textBoxText != "" && textBox2Text != "") { SetCheckPasswordBindingModel(textBoxText, textBox2Text, checkPasswordBindingModel); SetCheckFileBindingModelOKIsPressed(checkPasswordBindingModel); CheckForm.Close(); } else { ShowMessageBox(); } }
public static async void CheckIfTextBoxIsEmptyAsync(string textBoxText, string textBox2Text, CheckPassword CheckForm, CheckPasswordBindingModel checkPasswordBindingModel) { //uses string textBoxText and textBox2Text to get user input for the password and the IV for decryption. //uses CheckPassword Form to close the specific Form //uses CheckPasswordBindingModel to set its properties. if (textBoxText != "" && textBox2Text != "") { await Task.Run(() => SetCheckPasswordBindingModel(textBoxText, textBox2Text, checkPasswordBindingModel)); await Task.Run(() => SetCheckFileBindingModelOKIsPressed(checkPasswordBindingModel)); CheckForm.Close(); } else { await Task.Run(() => ShowMessageBox()); } }
private static void SetCancelIsPressed(CheckPassword CheckForm, CheckPasswordBindingModel checkPasswordBindingModel) { checkPasswordBindingModel.CancelIsPressed = true; CheckForm.Close(); }