private void addFolderFromSystemToolStripMenuItem_Click(object sender, EventArgs e) { if (treeFileFolders.SelectedNode == null) { return; } string folder = treeFileFolders.SelectedNode.FullPath; if (folder.EndsWith("\\") == false) { folder += "\\"; } FolderBrowserDialog fldr = new FolderBrowserDialog(); fldr.Description = "Browse for files to add to " + folder; fldr.ShowNewFolderButton = false; if (fldr.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) { return; } foreach (string filename in Directory.EnumerateFiles(fldr.SelectedPath, "*.*", SearchOption.AllDirectories)) { PKGFile file = new PKGFile(); file.FileName = Path.GetFileName(filename); string p = Path.GetDirectoryName(filename); p = p.Substring(fldr.SelectedPath.Length); if (p.StartsWith("\\") == true) { p = p.Substring(1); } p = folder + p; if (p.EndsWith("\\") == false) { p += "\\"; } file.FolderName = p; if (file.FolderName.EndsWith("\\") == false) { file.FolderName += "\\"; } file.SrcFile = filename; file.ID = ""; file.InstallThisFile = true; PackageDataUtilities.AddNewFile(Package, file); CreateFileFolder(file.FolderName); } LoadFileList(); }
private void propertiesToolStripMenuItem_Click(object sender, EventArgs e) { if (lstFiles.SelectedItems.Count == 0) { return; } if (lstFiles.SelectedItems.Count > 1) { return; } PKGFile f = (PKGFile)lstFiles.SelectedItems[0].Tag; frmFileProperties frm = new frmFileProperties(f); if (frm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) { return; } LoadFileList(); }
public static void AddNewFile(PKGRootData Package, PKGFile file) { if (file.FileName.Trim() == "") { return; } if (file.SrcFile.Trim() == "") { return; } if (file.FolderName.EndsWith("\\") == false) { file.FolderName += "\\"; } AddNewFolder(Package, file.FolderName); Package.Files.Add(file); }
private void cmdOK_Click(object sender, EventArgs e) { if (file == null) { file = new PKGFile(); file.FolderName = txtDestPath.Text.Trim(); file.FileName = txtDestFilename.Text.Trim(); file.SrcFile = txtSrcFilename.Text.Trim(); file.ID = txtID.Text.Trim(); file.InstallThisFile = chkInstall.Checked; file.KeepInMeta = chkKeepMeta.Checked; } else { file.FolderName = txtDestPath.Text.Trim(); file.FileName = txtDestFilename.Text.Trim(); file.SrcFile = txtSrcFilename.Text.Trim(); file.ID = txtID.Text.Trim(); file.InstallThisFile = chkInstall.Checked; file.KeepInMeta = chkKeepMeta.Checked; } this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
public frmFileProperties(PKGFile pkgfile) { file = pkgfile; newpaath = null; InitializeComponent(); }
public frmFileProperties(string path) { newpaath = path; file = null; InitializeComponent(); }