private void connection_OnLogin(object sender, string username, string ipAddress)
 {
     Invoke((Action)(() =>
     {
         label1.Text = "Test Result:";
         label2.Text = "SUCCESS - Account works.";
         gifImage = new GifImage(LoliBot.Properties.Resources.glasses);
         button1.Enabled = true;
         _connection.Disconnect();
     }));
 }
 public AccountManager_TEST(string username, string password, string region)
 {
     InitializeComponent();
     gifImage = new GifImage(Properties.Resources.table);
     gifImage.ReverseAtEnd = false;
     pictureBox1.Image = gifImage.GetFrame(0);
     timer1.Enabled = true;
     _connection = new LoLConnection();
     _connection.OnLogin += new LoLConnection.OnLoginHandler(connection_OnLogin);
     _connection.OnError += new LoLConnection.OnErrorHandler(connection_OnError);
     BaseRegion testRegion = BaseRegion.GetRegion(region);
     _connection.Connect(username, password, testRegion.PVPRegion, Config.clientSeason + "." + Config.clientSubVersion);
 }
        public AccountManager_TEST(string username, string password, string region)
        {
            InitializeComponent();
            gifImage = new GifImage(LoliBot.Properties.Resources.table);
            gifImage.ReverseAtEnd = false;
            pictureBox1.Image = gifImage.GetFrame(0);
            timer1.Enabled = true;
            _connection = new LoLConnection();
            _connection.OnLogin += new LoLConnection.OnLoginHandler(connection_OnLogin);
            _connection.OnError += new LoLConnection.OnErrorHandler(connection_OnError);
            BaseRegion testRegion = BaseRegion.GetRegion(region);
            string folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string specificFolder = Path.Combine(folder, "LoliBot");
            string path = specificFolder;
            IniFile ini = new IniFile(path + "\\version.ini");
            _connection.Connect(username, password, testRegion.PVPRegion, ini.IniReadValue("General", "version"));

        }