private void EditSplits() { var runCopy = CurrentState.Run.Clone() as IRun; var activeAutoSplitters = new List<string>(CurrentState.Settings.ActiveAutoSplitters); var editor = new RunEditorDialog(CurrentState); editor.RunEdited += editor_RunEdited; editor.ComparisonRenamed += editor_ComparisonRenamed; editor.SegmentRemovedOrAdded += editor_SegmentRemovedOrAdded; try { TopMost = false; IsInDialogMode = true; if (CurrentState.CurrentPhase == TimerPhase.NotRunning) editor.AllowChangingSegments = true; var result = editor.ShowDialog(this); if (result == DialogResult.Cancel) { foreach (var image in runCopy.Select(x => x.Icon)) editor.ImagesToDispose.Remove(image); editor.ImagesToDispose.Remove(runCopy.GameIcon); CurrentState.Settings.ActiveAutoSplitters = activeAutoSplitters; SetRun(runCopy); CurrentState.CallRunManuallyModified(); } foreach (var image in editor.ImagesToDispose) image.Dispose(); } finally { TopMost = Layout.Settings.AlwaysOnTop; IsInDialogMode = false; } }
private void EditSplits() { var runCopy = CurrentState.Run.Clone() as IRun; var editor = new RunEditorDialog(CurrentState); editor.RunEdited += editor_RunEdited; editor.ComparisonRenamed += editor_ComparisonRenamed; editor.ComparisonRemoved += editor_ComparisonRemoved; editor.SegmentRemovedOrAdded += editor_SegmentRemovedOrAdded; try { this.TopMost = false; IsInDialogMode = true; if (CurrentState.CurrentPhase == TimerPhase.NotRunning) editor.AllowChangingSegments = true; var result = editor.ShowDialog(this); if (result == DialogResult.Cancel) SetRun(runCopy); } finally { this.TopMost = Layout.Settings.AlwaysOnTop; IsInDialogMode = false; } }