Ejemplo n.º 1
0
 private void _testController_TestEnd(object sender, TestEndEventArgs e)
 {
     _UpdateTimer.Stop();
     Dispatcher.Invoke(() => {
         SetTestArea(string.Empty);
         EntryBox.Clear();
         TimeLabel.Content = "0:0";
     });
 }
        /// <summary>
        /// adds a new Type
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTypesAdd_Click(object sender, RoutedEventArgs e)
        {
            var entry = EntryBox.Show(Properties.Resources.EntryType);

            if (!string.IsNullOrEmpty(entry))
            {
                Main.CompanyTypeManager.CompanyTypes.GetCurrent().Types.Add(new Logic.Data.Type(entry));
                Update();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// adds a new Feature to the OS
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFeatureAdd_Click(object sender, RoutedEventArgs e)
        {
            var entry = new EntryBox(Properties.Resources.EntryFeature).Show();

            if (!string.IsNullOrEmpty(entry))
            {
                Main.CompanyManager.Companies.Current.Products.GetCurrent().Features.Add(entry);
                this.Update();
            }
        }
Ejemplo n.º 4
0
        private void Window_Initialized(object sender, EventArgs e)
        {
            Logger.OnLog       += Log;
            Logger.DebugLogging = DebugLogToggle.IsChecked ?? false;

            Evaluator.Initialize();

            EntryBox.Focus();

            ShowBtn_Click(ShowBtn, null);
        }
Ejemplo n.º 5
0
        private void _uiUpdateTimer_Tick(object sender, EventArgs e)
        {
            TestTelemetry testTelemetry = _testController.GetCurrentTelemetry();

            SetTestArea(_testString);

            if (_clearEntryBox)
            {
                EntryBox.Clear();
                _clearEntryBox = false;
            }
            if (_mistakeMade)
            {
                EntryBox.SelectionStart  = EntryBox.Text.Length;
                EntryBox.SelectionLength = 0;
                _mistakeMade             = false;
            }

            SpeedLabel.Content = string.Format("{0} WPM", testTelemetry.WPM);
            TimeLabel.Content  = string.Format("{0}:{1}", testTelemetry.ElapsedTime.Minutes, testTelemetry.ElapsedTime.Seconds);
        }
Ejemplo n.º 6
0
        private void GoBtn_Click(object sender, RoutedEventArgs e)
        {
            string input = EntryBox.Text;

            ListBoxItem inputLBI = new ListBoxItem();

            inputLBI.Content = input;
            inputLBI.HorizontalContentAlignment = HorizontalAlignment.Left;
            inputLBI.HorizontalAlignment        = HorizontalAlignment.Stretch;
            HistoryBox.Items.Add(inputLBI);

            IResultValue irv       = Evaluator.Evaluate(input);
            ListBoxItem  outputLBI = new ListBoxItem();

            outputLBI.Content = irv.ToDisplayString();
            outputLBI.HorizontalContentAlignment = HorizontalAlignment.Right;
            outputLBI.HorizontalAlignment        = HorizontalAlignment.Stretch;
            HistoryBox.Items.Add(outputLBI);

            EntryBox.Text = "";
            EntryBox.Focus();
        }
Ejemplo n.º 7
0
 private void StringDialog_Shown(object sender, EventArgs e)
 {
     EntryBox.Text = String;
     EntryBox.Focus();
     EntryBox.SelectAll();
 }