Exemple #1
0
        private void MainForm_Load(object sender, System.EventArgs e)
        {
            //Register log event handler
            TestCenter.Logger.LogEnterred +=
                new TestLogger.LogEventHandler(Logger_LogEnterred);

            //Grab the center
            m_testcenter = TestCenter.GetInstance();

            //Init the image list
            lstMessages.SmallImageList = new ImageList();
            lstMessages.SmallImageList.Images.Add(new Bitmap("error.bmp"));
            lstMessages.SmallImageList.Images.Add(new Bitmap("info.bmp"));
            lstMessages.SmallImageList.Images.Add(new Bitmap("warning.bmp"));

            UpdateStatus();
        }
Exemple #2
0
 private void cmdLogin_Click(object sender, System.EventArgs e)
 {
     if (txtUsername.Text == "" || txtPassword.Text == "")
     {
         FormError("Please enter a username and password");
     }
     else
     {
         if (!TestCenter.GetInstance().Authenticate(txtUsername.Text, txtPassword.Text))
         {
             FormError("Either the username or password is incorrect");
         }
         else
         {
             DialogResult = DialogResult.OK;
         }
     }
 }