void FinishSession() { try { using (AsynchronousWaitDialog dlg = AsynchronousWaitDialog.ShowWaitDialog(StringParser.Parse("${res:AddIns.Profiler.Messages.PreparingForAnalysis}"), true)) { profiler.Dispose(); WorkbenchSingleton.SafeThreadAsyncCall(() => { controlWindow.AllowClose = true; this.controlWindow.Close(); }); if (database != null) { database.WriteTo(writer, progress => { dlg.Progress = progress; return(!dlg.CancellationToken.IsCancellationRequested); }); writer.Close(); database.Close(); } else { writer.Close(); } if (!dlg.CancellationToken.IsCancellationRequested) { OnRunFinished(EventArgs.Empty); } } } catch (Exception ex) { MessageService.ShowException(ex); } }
/// <inheritdoc/> public void Close() { targetWriter.Close(); }