private void Menucategoryadd_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog { InitialDirectory = LibCommon.AppContext.GetInstance().Config.GetConfigParamValue("UISetting", "LastAccessDir"), Multiselect = true }; if (dialog.ShowDialog() == DialogResult.OK) { LibCommon.AppContext.GetInstance().Config.SetConfigParamValue("UISetting", "LastAccessDir", FileHelper.GetFileDir(dialog.FileNames[0])); RadTreeNode selectedNode = navigateTree.SelectedNode; RadTreeNode batchNode = selectedNode.GetBatchNode(); NBatchInfo batchInfo = batchNode.Tag as NBatchInfo; List <NFileInfo> fileInfos = BeanUtil.FileDialog2FileInfo(dialog, batchInfo.BatchNO); AddNodeWithFileInfo(selectedNode, fileInfos, batchInfo); UpdateBatchNodeTitle(batchNode); batchNode.ExpandAll(); } }
private void BatchNode_AddLocalF_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog { InitialDirectory = LibCommon.AppContext.GetInstance().Config.GetConfigParamValue("UISetting", "LastAccessDir"), Multiselect = true }; if (dialog.ShowDialog() == DialogResult.OK) { LibCommon.AppContext.GetInstance().Config.SetConfigParamValue("UISetting", "LastAccessDir", FileHelper.GetFileDir(dialog.FileNames[0])); RadTreeNode selectedNode = navigateTree.SelectedNode; //string str = selectedNode.FullPath.ToString().Substring(selectedNode.FullPath.ToString().LastIndexOf("]") + 1); NBatchInfo batchInfo = selectedNode.Tag as NBatchInfo; //新增文件转为NFileInfo对象 List <NFileInfo> fileInfos = BeanUtil.FileDialog2FileInfo(dialog, batchInfo.BatchNO); //批次节点下增加文件节点 AddNodeWithFileInfo(selectedNode, fileInfos, batchInfo); UpdateBatchNodeTitle(selectedNode); selectedNode.ExpandAll(); } }