private void fileList_DragDrop(object sender, DragEventArgs e) { // Find the selcted feature SetupFeature feature = null; try { feature = (SetupFeature)featuresTree.SelectedNode.Tag; } catch (NullReferenceException) { return; } string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string file in files) { string my_file = currentProject.projectProperties.UseRelativePaths ? Shell.GetRelativePath(file) : file; SetupFile sf = feature.AddFile(my_file); } // Reload the file-list ReloadFileList(); }
private void addFilesMenu_Click(object sender, EventArgs e) { SetupFeature feature = null; try { feature = (SetupFeature)featuresTree.SelectedNode.Tag; } catch (NullReferenceException) { return; } // Open file-dialog OpenFileDialog dlg = new OpenFileDialog(); dlg.Multiselect = true; dlg.RestoreDirectory = true; if (dlg.ShowDialog() == DialogResult.OK) { // Add the target-files string[] files = dlg.FileNames; foreach (string file in files) { string my_file = currentProject.projectProperties.UseRelativePaths ? Shell.GetRelativePath(file) : file; SetupFile sf = feature.AddFile(my_file); } // Reload the file-list ReloadFileList(); } }