Пример #1
0
        void FinishSession()
        {
            try {
                using (AsynchronousWaitDialog dlg = AsynchronousWaitDialog.ShowWaitDialog(StringParser.Parse("${res:AddIns.Profiler.Messages.PreparingForAnalysis}"), true)) {
                    profiler.Dispose();
                    SD.MainThread.InvokeAsyncAndForget(() => { controlWindow.AllowClose = true; 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);
            }
        }
Пример #2
0
        void FinishSession()
        {
            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.IsCancelled);
                    writer.Close();
                    database.Close();
                }
                else
                {
                    writer.Close();
                }

                if (!dlg.IsCancelled)
                {
                    OnRunFinished(EventArgs.Empty);
                }
            }
        }