protected override void Run() { var selector = new FileSelectorDialog("Open session"); string filename = null; try { var result = MessageService.RunCustomDialog(selector, MessageService.RootWindow); if (result == (int)Gtk.ResponseType.Cancel) { return; } filename = selector.Filename; } finally { selector.Destroy(); } AutoTestService.ReplaySessionFromFile(filename); }
protected override void Run() { if (AutoTestService.CurrentRecordSession == null) { AutoTestService.StartRecordingSession(); } else { var selector = new FileSelectorDialog("Save session as...", Gtk.FileChooserAction.Save); try { var result = MessageService.RunCustomDialog(selector, MessageService.RootWindow); if (result == (int)Gtk.ResponseType.Cancel) { return; } AutoTestService.StopRecordingSession(selector.Filename); } finally { selector.Destroy(); } } }