Esempio n. 1
0
 private void Clear_Button_Click(object sender, RoutedEventArgs e)
 {
     InputText.Clear();
     Key.Text        = "";
     EncodeText.Text = "";
     DecodeText.Text = "";
 }
Esempio n. 2
0
 public void Dispose()
 {
     Enumerator?.Dispose();
     InputText?.Clear();
     Session.Dispose();
     Enumerator        = null;
     EnumeratedResults = null;
 }
Esempio n. 3
0
 private void button19_Click(object sender, EventArgs e)
 {
     a = float.Parse(InputText.Text);
     InputText.Clear();
     count       = 5;
     label1.Text = a.ToString() + "^";
     znak        = true;
 }
Esempio n. 4
0
        private void InputText_TextChanged(object sender, TextChangedEventArgs e)
        {
            Socket socket = null;

            if (SocketCombo.SelectedValue != null)
            {
                socket = sockets[(IntPtr)SocketCombo.SelectedValue];
            }

            if (socket == null || InputText.Text == "" || InputText.Text == "\\")
            {
                return;
            }

            string text = InputText.Text;

            if (text.StartsWith("`"))
            {
                if (text.Length >= 2 && text.EndsWith("`"))
                {
                    text = text.Substring(1, text.Length - 2);
                }
                else
                {
                    return;
                }

                if (text == "")
                {
                    text = "\r\n";
                }
            }

            byte[] buffer;
            if (text.StartsWith("~"))
            {
                if (text.Length >= 2 && text.EndsWith("~"))
                {
                    buffer = Common.ConvertToHEX(text.Substring(1, text.Length - 2));
                }
                else
                {
                    return;
                }
            }
            else
            {
                text   = text.Replace("\\n", "\n").Replace("\\r", "\r").Replace("\\\\", "\\").Replace("\\`", "`").Replace("\\~", "~");
                buffer = ASCIIEncoding.ASCII.GetBytes(text);
            }
            InputText.Clear();

            try
            {
                socket.Send(buffer);
            }
            catch (Exception exc) { Title = exc.Message; }
        }
Esempio n. 5
0
        private void button18_Click(object sender, EventArgs e)
        {
            int    length = InputText.Text.Length - 1;
            string text   = InputText.Text;

            InputText.Clear();
            for (int i = 0; i < length; i++)
            {
                InputText.Text = InputText.Text + text[i];
            }
        }
Esempio n. 6
0
 private void InputText_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         string messageText = InputText.Text.Trim();
         if (messageText.Length > 0)
         {
             var    appContext = ServiceLocator.Current.GetInstance <IAppContext>();
             Player recipient  = RecipientBox.SelectedItem as Player;
             if (recipient == _globalPlayer)
             {
                 recipient = null;
             }
             ClientCommands.SendChatMessage.Execute(new ChatMessage(appContext.LocalPlayer, messageText, recipient));
             InputText.Clear();
         }
     }
 }
Esempio n. 7
0
        private void InputText_TextChanged(object sender, EventArgs e)
        {
            if (InputText.Text.Length == MovingButton.Text.Length || InputText.Text.Length == MovingButton2.Text.Length || InputText.Text.Length == MovingButton3.Text.Length)
            {
                if (InputText.Text == MovingButton.Text)
                {
                    score++;
                    // toggle between char and word
                    if (score < 30)
                    {
                        showButtonText(MovingButton);
                    }

                    else if (score > 29)
                    {
                        showButtonWord(MovingButton);
                    }
                    /////////////////


                    if (score == 5)
                    {
                        //increase speed
                        timer1.Interval /= 2;
                    }
                    if (score == 10)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 2");
                        timer1.Start();
                        timer2 = 700;

                        //show 2 chars instead of one
                        showButtonText(MovingButton2);
                    }



                    if (score == 20)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 3");
                        timer1.Start();
                        timer3 = 700;

                        //show 3 chars instead of 2
                        showButtonText(MovingButton3);
                    }
                    if (score == 30)
                    {
                        MovingButton.Visible = false;
                        MovingButton.Text    = "أ";

                        MovingButton2.Visible = false;
                        MovingButton2.Text    = "أ";

                        MovingButton3.Visible = false;
                        MovingButton3.Text    = "أ";

                        timer1.Stop();
                        MessageBox.Show("Level 4");
                        timer1.Start();
                        timer = 700;

                        //show just 1 word
                        showButtonWord(MovingButton);
                    }

                    if (score == 40)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 5");
                        timer1.Start();
                        timer2 = 700;

                        //show 2 words
                        showButtonWord(MovingButton2);
                    }

                    if (score == 50)
                    {
                        timer1.Stop();

                        MessageBox.Show("Level 6");
                        timer1.Start();
                        timer3 = 700;

                        //show 3 words
                        showButtonWord(MovingButton3);

                        //increase speed
                        timer1.Interval *= 2;
                    }

                    if (score == 60)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 7");
                        timer1.Start();

                        timer3 = 700;
                        //showButtonWord(MovingButton3);
                    }

                    if (score == 70)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 8");
                        timer1.Start();

                        timer3 = 700;
                        // showButtonWord(MovingButton3);
                        //timer1.Interval /= 2;
                    }

                    ScoreLabel.Text = score.ToString();
                    timer           = 700;
                    RandomNum       = random.Next(100, 1000);
                    InputText.Clear();
                }
                else if (InputText.Text == MovingButton2.Text)
                {
                    score++;


                    if (score > 9 && score < 30)
                    {
                        showButtonText(MovingButton2);
                    }

                    else if (score > 39)
                    {
                        showButtonWord(MovingButton2);
                    }


                    if (score == 20)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 3");
                        timer1.Start();
                        timer3 = 700;
                        showButtonText(MovingButton3);
                        //timer1.Interval /= 5;
                    }

                    if (score == 30)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 4");
                        timer1.Start();

                        MovingButton.Visible = false;
                        MovingButton.Text    = "أ";

                        MovingButton2.Visible = false;
                        MovingButton2.Text    = "أ";

                        MovingButton3.Visible = false;
                        MovingButton3.Text    = "أ";
                        //timer1.Interval *= 10;
                        timer = 700;
                        showButtonWord(MovingButton);
                        //timer1.Interval *= 4;
                    }

                    if (score == 50)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 5");
                        timer1.Start();

                        timer3 = 700;
                        showButtonWord(MovingButton3);
                        //timer1.Interval /= 5;
                    }

                    ScoreLabel.Text = score.ToString();
                    InputText.Clear();
                    timer2     = 700;
                    RandomNum2 = random.Next(100, 1000);
                }

                else if (InputText.Text == MovingButton3.Text)
                {
                    score++;

                    if (score > 19 && score < 30)
                    {
                        showButtonText(MovingButton3);
                    }



                    if (score == 30)
                    {
                        timer1.Stop();
                        MessageBox.Show("Level 4");
                        timer1.Start();
                        MovingButton.Visible = false;
                        MovingButton.Text    = "أ";

                        MovingButton2.Visible = false;
                        MovingButton2.Text    = "أ";

                        MovingButton3.Visible = false;
                        MovingButton3.Text    = "أ";
                        //timer1.Interval *= 10;
                        timer = 700;
                        showButtonWord(MovingButton);
                        //timer1.Interval /= 4;
                    }

                    if (score > 49)
                    {
                        showButtonWord(MovingButton3);
                    }

                    ScoreLabel.Text = score.ToString();
                    timer3          = 700;
                    RandomNum3      = random.Next(100, 1000);
                    InputText.Clear();
                }

                else if (InputText.Text.Length >= (Math.Max(Math.Max(MovingButton.Text.Length, MovingButton2.Text.Length), MovingButton3.Text.Length)))
                {
                    InputText.Clear();
                }
            }
        }