public ObjectElement cloneForExceport(ObjectVector parent) { ScriptFileElement newInstance = new ScriptFileElement(parent); if (value != null) { newInstance.value = ((String)value) + ""; } return newInstance; }
public override ObjectElement clone() { ScriptFileElement newInstance = new ScriptFileElement(parent); if (value != null) { newInstance.value = ((String)value) + ""; } return newInstance; }
public ObjectElement cloneForExceport(ObjectVector parent) { ScriptFileElement newInstance = new ScriptFileElement(parent); if (value != null) { newInstance.value = ((String)value) + ""; } return(newInstance); }
public override ObjectElement clone() { ScriptFileElement newInstance = new ScriptFileElement(parent); if (value != null) { newInstance.value = ((String)value) + ""; } return(newInstance); }
//增加kss脚本单元 public void kss_addElement() { int idCarrier = listBox_Carrier.SelectedIndex; int idFile = listBox_Files.SelectedIndex; if (idCarrier >= 0) { kss_checkPath(); OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = true; dialog.Filter = "c2ds files (*.c2ds)|*.c2ds"; dialog.FileName = ""; dialog.Title = "添加kss脚本文件"; String subFolderName = Consts.PATH_PROJECT_FOLDER + Consts.SUBPARH_KSS; dialog.InitialDirectory = subFolderName; DialogResult dr = dialog.ShowDialog(); if (dr != DialogResult.OK) { return; } for (int i = 0; i < dialog.FileNames.Length; i++) { ScriptFileElement element = new ScriptFileElement(listCarrier[idCarrier]); String srcPath = dialog.FileNames[i]; String strFile = srcPath.Substring(srcPath.LastIndexOf('\\') + 1, srcPath.Length - srcPath.LastIndexOf('\\') - 1); String strFolder = srcPath.Replace(strFile, ""); String destPath = subFolderName + strFile; bool dontCopy = false; if (strFolder.Equals(subFolderName)||srcPath.Equals(destPath)) { dontCopy = true; } if (!dontCopy && File.Exists(destPath)) { DialogResult drI = MessageBox.Show("工程目录已经包含同名文件,是否替换?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (drI == DialogResult.No) { dontCopy = true; } } if (!dontCopy) { File.Copy(srcPath, destPath,true); } element.setValue(strFile); listCarrier[idCarrier].addElement(element); } } }
//设置kss脚本单元 public void kss_configElement() { int idCarrier = listBox_Carrier.SelectedIndex; int idFile = listBox_Files.SelectedIndex; if (idCarrier >= 0 && idFile >= 0) { kss_checkPath(); OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = false; dialog.Filter = "c2dx files (*.c2dx)|*.c2dx"; dialog.FileName = ""; dialog.Title = "重设kss脚本文件"; String subFolderName = Consts.PATH_PROJECT_FOLDER + Consts.SUBPARH_KSS; dialog.InitialDirectory = subFolderName; DialogResult dr = dialog.ShowDialog(); if (dr != DialogResult.OK) { return; } ScriptFileElement element = new ScriptFileElement(listCarrier[idCarrier]); String value = dialog.FileName.Replace(subFolderName, ""); element.setValue(value); listCarrier[idCarrier].setElement(element, idFile); } }