private ERR_RESULT inner_CreateTest(TaskClass tskObj, XElement objectsNode) { ERR_RESULT result = new ERR_RESULT(); XElement testNode = null; XElement imgRefNode = null; try { testNode = new XElement("test"); foreach (UInt32 key in tskObj.p_ImageFileKeys) { TaskClass.IMAGEFILEPATH img = tskObj.p_ImageFileMaps[key]; imgRefNode = new XElement("ImgRef", new XAttribute("Ref", img.id)); testNode.Add(imgRefNode); } objectsNode.Add(testNode); return(result); } catch (_XmlException err) { result = ErrProcess.SetErrResult(err); return(result); } catch (Exception err) { result = ErrProcess.SetErrResult(err); return(result); } }
private void inner_CopyImagePathToTaskClass(string[] dropFiles, TaskClass task) { string[] tempPath = new string[dropFiles.Length]; string fileName = null; TaskClass.IMAGEFILEPATH path; int i = 0; foreach (string dropfile in dropFiles) { path = new TaskClass.IMAGEFILEPATH(); string dropFileName = ExtractDropFileName(dropfile); string newPath = m_WorkspaceDoc.localPath + "\\" + task.p_Pareants.p_Pareants.p_Name + "\\" + task.p_Pareants.p_Name + "\\" + task.p_Name + "\\" + dropFileName; tempPath[i] = newPath; //Doc → taskClass path.targetPath = tempPath[i]; path.originPath = dropfile; path.FileName = dropFileName; path.id = "IMG_" + ((UInt32)path.GetHashCode()).ToString(); task.p_ImageFileKeys.Add((UInt32)path.GetHashCode()); task.p_ImageFileMaps[(UInt32)path.GetHashCode()] = path; // List <ImageItem> items = new List <ImageItem>(); foreach (UInt32 key in task.p_ImageFileKeys) { path = task.p_ImageFileMaps[key]; ImageItem item = new ImageItem(); string filename = ExtractDropFileName(path.targetPath); item.p_FileName = filename; item.p_ImgId = uint.Parse(path.id.Split('_')[1]); items.Add(item); } //if (IMG_LSTVIEW_UI.ILV_GetImgItems().Count != 0) // IMG_LSTVIEW_UI.ILV_Clearitem(); //foreach (ImageItem item in items) //{ // IMG_LSTVIEW_UI.ILV_insertitem(item); //} i++; } }