public static List <string> GetFileNames(HHI_HandIn hi) { List <string> files; // process folder if (hi.IsSubItemFolder) { // process file files = HHI_Module.FindFolders(hi.Path); } else { // process file files = HHI_Module.FindFile(hi.Path); } return(files); }
public static List <int> GetUnAttachedWorkIndexs(HHI_HandIn hi, HHI_Prefix prefix) { List <int> digit = GetPrefixIndexList(prefix); List <string> files = GetFileNames(hi); foreach (var file in files) { string strRet = FileNameToIndex(file); if (strRet.Equals("")) { continue; } for (int j = 0; j < digit.Count; ++j) { if (digit[j] == Convert.ToInt32(strRet)) { digit.Remove(digit[j]); break; } } } return(digit); }
public static void LoadHandIns() { m_handInxml.Load(m_handInPath); //<prefixs> XmlNode rootNode = m_handInxml.SelectSingleNode("hhis"); XmlNodeList firstLevelNodeList = rootNode.ChildNodes; //<prefix> int i = 0; foreach (XmlNode node in firstLevelNodeList) { HHI_HandIn tmp = new HHI_HandIn(); tmp.Name = node.Attributes["name"].Value; tmp.IsSubItemFolder = Convert.ToBoolean(node.Attributes["isSubItemFolder"].Value); // get infos XmlNodeList prefixInfos = node.ChildNodes; tmp.Path = prefixInfos.Item(0).InnerText; tmp.Regex = prefixInfos.Item(1).InnerText; tmp.PrefixName = prefixInfos.Item(2).InnerText; tmp.ID = i; listHandInData.Add(tmp); ++i; } }