private void DelBtn_Click(object sender, EventArgs e)
 {
     DataList.Items.Clear();
     myList.Clear();
     OutputLabel.Text = "Input";
     UserBox.Clear();
     ShowBox.Clear();
     InputBox.Clear();
 }
Ejemplo n.º 2
0
        public IWebElement Login(string name, string password)
        {
            WaitForElement(By.Id("UserName"));
            UserBox.Clear();
            UserBox.SendKeys(name);

            WaitForElement(By.Id("Password"));
            PasswordBox.Clear();
            PasswordBox.SendKeys(password);

            WaitForElement(By.Id("Login"));
            LoginButton.Click();

            WaitForElement(By.Id("Home"));
            return(HomeElement);
        }
        public IWebElement Register(string name, string password)
        {
            WaitForElement(By.Id("UserName"));
            UserBox.Clear();
            UserBox.SendKeys(name);

            WaitForElement(By.Id("Password"));
            PasswordBox.Clear();
            PasswordBox.SendKeys(password);

            WaitForElement(By.Id("PasswordRepeat"));
            PasswordRepeatBox.Clear();
            PasswordRepeatBox.SendKeys(password);

            WaitForElement(By.Id("Register"));
            RegisterButton.Click();

            //wait for result page - Send the User back to the login page
            WaitForElement(By.Id("Login"));
            return(LoginElement);
        }
Ejemplo n.º 4
0
        private void UserBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                if (_tempCount < Entrycollectionsize && UserBox.Text != string.Empty && _tempVars[_tempCount] != string.Empty)
                {
                    //Console.WriteLine(_tempVars[_tempCount] + @" " + _tempCount);
                    while (_tempVars[_tempCount] != null)
                    {
                        _tempCount++;
                    }

                    _tempVars[_tempCount] = UserBox.Text;
                    _tempCount++;
                }

                AppendDebugLine(Environment.NewLine + UserBox.Text, Color.FromRgb(51, 153, 255));

                if (!UserBox.Text.Contains("start"))
                {
                    AppendDebugLine(Rcon.DewCmd(UserBox.Text), Color.FromRgb(150, 150, 150));
                }

                if (UserBox.Text.Contains("start"))
                {
                    string start = UserBox.Text.Replace("start ", string.Empty) + @"\eldorado.exe";

                    var startInfo = new ProcessStartInfo
                    {
                        FileName  = @start,
                        Arguments = "-launcher"
                    };

                    try
                    {
                        Process.Start(startInfo);
                    }
                    catch
                    {
                        AppendDebugLine("Could not find eldorado.exe is the path correct?" + Environment.NewLine, Color.FromRgb(255, 255, 0));
                    }
                }

                UserBox.Clear();
                DebugLog.ScrollToEnd();
            }


            if (e.Key == Key.Up)
            {
                int temp = _tempCount - 1;
                if (temp >= 0)
                {
                    Console.WriteLine(_tempVars[temp] + @" " + temp);
                    UserBox.Clear();
                    UserBox.Text       = _tempVars[temp];
                    UserBox.CaretIndex = UserBox.Text.Length;
                    _tempCount--;
                }
                else
                {
                    Console.WriteLine(@"Can't go up (Last entry)");
                }
            }

            if (e.Key == Key.Down)
            {
                int temp = _tempCount + 1;
                if (temp < Entrycollectionsize && _tempVars[temp - 1] != null)
                {
                    Console.WriteLine(_tempVars[temp] + @" " + temp);
                    UserBox.Clear();
                    UserBox.Text       = _tempVars[temp];
                    UserBox.CaretIndex = UserBox.Text.Length;
                    _tempCount++;
                }
                else
                {
                    Console.WriteLine(@"Can't go down (First entry)");
                }
            }
        }
 private void ClnBtn_Click(object sender, EventArgs e)
 {
     UserBox.Clear();
     OutputLabel.Text = "Input";
 }
Ejemplo n.º 6
0
 /// <summary>
 /// this menu clears the TextBox
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Remove_Click(object sender, RoutedEventArgs e)
 {
     Name = "";
     UserBox.Clear();
 }