public override ErrorType Check() { if (textBox.Text.Length == 0) { ErrorString = "Name must be specified."; return(ErrorType.Error); } HistoryCache.Add(GetType().ToString(), Value); ErrorString = null; return(ErrorType.None); }
public override ErrorType Check() { if (textBox.Text.Length == 0) { ErrorString = "Client hasn't been specified."; return(ErrorType.Warning); } if (!System.IO.File.Exists(textBox.Text)) { ErrorString = "Client \"" + textBox.Text + "\" doesn't exist."; return(ErrorType.Warning); } HistoryCache.Add(GetType().ToString(), Value); ErrorString = null; return(ErrorType.None); }
public override ErrorType Check() { if (textBox.Text.Length == 0) { ErrorString = "Address hasn't been specified."; return(ErrorType.Warning); } Regex regex = new Regex(@"\A(?:[a-zA-Z0-9]|\x5F|\x2E)+,\d+\z"); if (!regex.IsMatch(textBox.Text)) { ErrorString = "Address has invalid format.\n\nExamples:\nlogin.owo.com,7775\n127.0.0.1,2593\n\n"; return(ErrorType.Warning); } HistoryCache.Add(GetType().ToString(), Value); ErrorString = null; return(ErrorType.None); }
public override ErrorType Check() { if (textBox.TextLength == 0) { ErrorString = "Account must be specified."; return(ErrorType.Error); } for (int i = 0; i < textBox.TextLength; i++) { if (textBox.Text[i] < 33) { ErrorString = "Account contains some invalid characters."; return(ErrorType.Warning); } } HistoryCache.Add(GetType().ToString(), Value); ErrorString = null; return(ErrorType.None); }