using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LiamTestTeams
{
    public partial class frmPermissionInput : Form
    {
        public frmPermissionInput()
        {
            InitializeComponent();
        }

        private void frmPermissionInput_Load(object sender, EventArgs e)
        {
            comboBoxRole.SelectedIndex = 0;
        }

        private void textBoxEmail_TextChanged(object sender, EventArgs e)
        {
            bool isValid = false;
            if (!string.IsNullOrWhiteSpace(textBoxEmail.Text))
            {
                try
                {
                    var mail = new System.Net.Mail.MailAddress(textBoxEmail.Text.Trim());
                    isValid =  mail != null;
                }
                catch
                {
                }
            }

            buttonOK.Enabled = isValid;
        }
    }
}
