private void StartStopSimulationBtn_Click(object sender, RoutedEventArgs e) { // checking the input parameters if (!GUIChecks.TryGetValue(LoadIntervalTextBox, out _interval)) { return; } if (_fileName == string.Empty || !File.Exists(_fileName)) { ErrorPrinting.PrintError("File" + _fileName + " doesn't exist. Please choose different file."); return; } if (_interval == 0) { ConsoleManager.ConsoleWriteMessage("Interval cannot be 0. Setting it to 1!"); _interval = 1; } if (!_simulating) { StartSimulation(_interval); } else if (_simulating) { StopSimulation(); } _simulating = !_simulating; }
private void TextBoxKeyDownPreview(object sender, KeyEventArgs e) { e.Handled = !GUIChecks.IsSpaceAllowed(e); }
private void TextBoxTextPreview(object sender, TextCompositionEventArgs e) { e.Handled = !GUIChecks.IsTextAllowedForDoubleNonNegative(e.Text); }
private void TextBoxOnChange(object sender, TextChangedEventArgs e) { GUIChecks.ReplaceDot(sender, e); }
private void LoadIntervalTextBox_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = !GUIChecks.IsSpaceAllowed(e); }
private void LoadIntervalTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e) { e.Handled = !GUIChecks.IsTextAllowedForUint(e.Text); }