private void OKbutton_Click(object sender, RoutedEventArgs e) { try { int number = 0; bool end = false; if (tillEndCheckbox.IsChecked ?? true) { end = true; } else { number = int.Parse(numberOfPatternsTextbox.Text); } int spacing = (int)spacingSlider.Value; double rotation = rotationSlider.Value / 180.0 * Math.PI; int shift = (int)shiftSlider.Value; bool randomize = randomizeNoteOrderCheckbox.IsChecked ?? true; DoubleJumpType type = parseJumpType(); pattern = new ConfiguredDoubleJumps(type, number, spacing, rotation, shift, randomize, end); DialogResult = true; Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public ConfiguredDoubleJumps(DoubleJumpType jumpType, int number, int spacing, double rotation, int shift, bool randomize, bool end) : base(PatternType.DoubleJumps, end) { this.jumpType = jumpType; this.number = number; this.spacing = spacing; this.rotation = rotation; this.shift = shift; this.randomize = randomize; this.end = end; }