OpenFilenames() public static method

public static OpenFilenames ( IEnumerable filenames, MainWindow mainWindow = null ) : IEnumerator
filenames IEnumerable
mainWindow MainWindow
return IEnumerator
コード例 #1
0
        private void MainWindow_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                var filenames = (string[])e.Data.GetData(DataFormats.FileDrop);

                Scheduler.Start(
                    Program.OpenFilenames(filenames, this),
                    TaskExecutionPolicy.RunAsBackgroundTask
                    );
            }
        }
コード例 #2
0
        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
                    );
            }
        }