OK vergesst es. Mein Fehler. Das Ereignis wird nur aufgerufen, wenn man die Asynchrone Version der entsprechenden Methode aufruft:
Code:
private void button1_Click(object sender, EventArgs e)
{
string state;
validateEmail1.IsValidEmailAsync(txtEMail.Text);
/*Boolean valid = validateEmail1.IsValidEmail(txtEMail.Text);
if (valid)
{
lblValid.ForeColor = Color.Green;
lblValid.Text = "gültig";
}
else
{
lblValid.ForeColor = Color.Red;
lblValid.Text = "ungültig";
}*/
}
private void validateEmail1_IsValidEmailCompleted(object sender, IsValidEmailCompletedEventArgs e)
{
toolStripStatusLabel1.Text = "fertig";
if (e.Result)
{
lblValid.ForeColor = Color.Green;
lblValid.Text = "gültig";
}
else
{
lblValid.ForeColor = Color.Red;
lblValid.Text = "ungültig";
}
}