예제 #1
0
        private async void ButtonStart_Click(object sender, System.EventArgs e)
        {
            var progressReport = new Progress <int>(ReportCardProgress);

            TextBoxResult.Clear();
            ProgressBarCards.Value = 0;

            PictureBoxLoding.Visible = true;
            // await Wait();
            // var name = TextBoxInput.Text;

            var stopwatch = new Stopwatch();

            try
            {
                // var greeting = await GetGreetings(name);
                // MessageBox.Show(greeting);

                var cards = await GetCards(1000);

                stopwatch.Start();
                await ProcessCards(cards, progressReport);
            }
            catch (HttpRequestException ex)
            {
                MessageBox.Show(ex.Message);
            }
            MessageBox.Show($"Operation done in {stopwatch.ElapsedMilliseconds / 1000.0} seconds");
            PictureBoxLoding.Visible = false;
        }
예제 #2
0
        // NUMBERS -------------------------------------------------->>
        private void ButtonClick(object sender, EventArgs e)
        {
            // Clears '0' if there is any on the Text Screen
            if (TextBoxResult.Text == "0" || isOperationPerformed)
            {
                TextBoxResult.Clear();
            }

            isOperationPerformed = false;

            // Gets the value of each button on to the text Screen
            Button button = (Button)sender;

            // Take care to only have ONE decimal (".") in the Text Screen
            if (button.Text == ".")
            {
                if (!TextBoxResult.Text.Contains("."))
                {
                    TextBoxResult.Text = TextBoxResult.Text + button.Text;
                }
            }
            else
            {
                TextBoxResult.Text = TextBoxResult.Text + button.Text;
            }
        }
예제 #3
0
 private void ButtonCE_Click(object sender, EventArgs e)
 {
     if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString())
     {
         TextBoxResult.Text = "0";
         return;
     }
     TextBoxResult.Clear();
     TextBoxResult.Text = "0";
 }
예제 #4
0
        //Events for delete button (C , CE , DEL)
        private void ButtonC_Click(object sender, EventArgs e)
        {//Clear the Text box
            if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString())
            {
                TextBoxResult.Text = "0";
                return;
            }

            TextBoxResult.Clear();
            LabelHistory.Text  = "";
            TextBoxResult.Text = "0";
        }
예제 #5
0
        private void ButtonTask_Click(object sender, EventArgs e)
        {
            TextBoxResult.Clear();

            var words  = TextBoxSource.Text.Split(new[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
            var result = FormUtils.RunAlgorithm(words);

            foreach (var index in result)
            {
                TextBoxResult.AppendText(words[index] + '\n');
            }
        }
예제 #6
0
 private void HelperNumberButtonsToSetValue(string ValueToSet)
 {
     if (TextBoxResult.Text == "0")
     {
         TextBoxResult.Clear();
         TextBoxResult.Text = ValueToSet;
         return;
     }
     if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString())
     {
         TextBoxResult.Text = "0";
         return;
     }
     TextBoxResult.AppendText(ValueToSet);
 }
예제 #7
0
        private void Button_Click(object sender, EventArgs e)
        {
            if ((TextBoxResult.Text == "0") || (IsOperationPerformed))
            {
                TextBoxResult.Clear();
            }
            IsOperationPerformed = false;
            Button button = (Button)sender;

            if (button.Text == ",")
            {
                if (!TextBoxResult.Text.Contains(","))
                {
                    TextBoxResult.Text = TextBoxResult.Text + button.Text;
                }
            }
            else
            {
                TextBoxResult.Text = TextBoxResult.Text + button.Text;
            }
        }
예제 #8
0
        private void ButtonGetDataTable_OnClick(object sender, RoutedEventArgs e)
        {
            var result = _connectionManager.GetDataTable(TextBoxCommand.Text);

            TextBoxResult.Clear();

            foreach (var x in result.Columns)
            {
                TextBoxResult.Text += x + "\t\t";
            }

            TextBoxResult.Text += "\n";

            foreach (DataRow x in result.Rows)
            {
                foreach (var cell in x.ItemArray)
                {
                    TextBoxResult.Text += cell + "\t";
                }
                TextBoxResult.Text += "\n";
            }
        }
예제 #9
0
        private void HelperActionsButtonsToSetValue(String ValueToSet)
        {
            if (LabelHistory.Text.Contains(ValueToSet))
            {
                return;
            }
            if (TextBoxResult.Text.Remove(0, TextBoxResult.Text.Length - 1) == ".")
            {
                LabelHistory.Text = TextBoxResult.Text.Remove(TextBoxResult.Text.Length - 1) + ValueToSet;
                return;
            }
            if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString())
            {
                TextBoxResult.Clear();
                TextBoxResult.Text = "0";
                LabelHistory.Text  = "";
                return;
            }

            LabelHistory.Text  = TextBoxResult.Text + ValueToSet;
            TextBoxResult.Text = "0";
        }
예제 #10
0
        private void button_1_Click(object sender, EventArgs e)
        {
            if ((TextBoxResult.Text == "0") || (isOperation))
            {
                TextBoxResult.Clear();
            }


            isOperation = false;
            Button button = (Button)sender;

            if (button.Text == ".")
            {
                if (!TextBoxResult.Text.Contains("."))
                {
                    TextBoxResult.Text = TextBoxResult.Text + button.Text;
                }
            }
            else
            {
                TextBoxResult.Text = TextBoxResult.Text + button.Text;
            }
        }
 private void btnClear_Click(object sender, RoutedEventArgs e)
 {
     TextBoxResult.Clear();
 }
예제 #12
0
 private void clearAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     InputTextBox.Clear();
     TextBoxResult.Clear();
 }
예제 #13
0
 /// <summary>
 /// Очистка текстовых полей.
 /// </summary>
 private void ClearTextBoxes()
 {
     TextBoxSource.Clear();
     TextBoxResult.Clear();
 }
예제 #14
0
 /// <summary>
 /// Очищает поля формы
 /// </summary>
 public void ClearForm()
 {
     //TextBoxArg1.Clear();
     //TextBoxArg2.Clear();
     TextBoxResult.Clear();
 }