private void OpenFilesMenu_Click(object sender, EventArgs e)
{
using (var dialog = new OpenFileDialog()) {
dialog.Filter = "Heap Files|*.heaprecording;*.heapdiff|Heap Recordings|*.heaprecording|Heap Diffs|*.heapdiff";
dialog.CheckFileExists = true;
dialog.CheckPathExists = true;
dialog.Multiselect = true;
dialog.ShowReadOnly = false;
dialog.Title = "Open";
if (dialog.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
return;
Scheduler.Start(
Program.OpenFilenames(dialog.FileNames, this),
TaskExecutionPolicy.RunAsBackgroundTask
);
}
}