public Dictionary <string, List <string> > lookup(string filename) { filename = filename.Trim(); XmlNodeList metadataFileNodes = doc.SelectNodes("/metadatatable/metadatatype/metadatavalue/file"); foreach (XmlNode metadataFileNode in metadataFileNodes) { //check if the file exsist if (filename.Equals(metadataFileNode.InnerText)) { Debug.WriteLine("found file " + filename); fileNode = new MetaFileNode(filename); break; } } //if exsist if (fileNode != null) { foreach (XmlNode metadataFileNode in metadataFileNodes) { if (filename.Equals(metadataFileNode.InnerText)) { string key1 = metadataFileNode.ParentNode.ParentNode.Attributes.GetNamedItem("value").Value; string val = metadataFileNode.ParentNode.Attributes.GetNamedItem("value").Value; fileNode.SetDictObject(key1, val); } } printDict(fileNode.fileMetaDict); return(fileNode.fileMetaDict); } //end if (fileNode != null), fileNode built successfully return(null); }
public Dictionary <string, List <string> > lookup(string filename, bool isfullpath) { if (isfullpath) { return(lookup(filename)); } filename = filename.Trim(); XmlNodeList metadataFileNodes = doc.SelectNodes("/metadatatable/metadatatype/metadatavalue/file"); foreach (XmlNode metadataFileNode in metadataFileNodes) { //check if the file exsist string full_path = metadataFileNode.InnerText; string file_name = full_path.Split(Path.DirectorySeparatorChar).Last(); if (file_name.Equals(filename)) { fullFileName = full_path; Debug.WriteLine("found file ~~~~~~~~~~~~~~~~~ " + filename); fileNode = new MetaFileNode(filename); break; } } //if exsist if (fileNode != null) { foreach (XmlNode metadataFileNode in metadataFileNodes) { string full_path = metadataFileNode.InnerText; string file_name = full_path.Split(Path.DirectorySeparatorChar).Last(); if (file_name.Equals(filename)) { string key1 = metadataFileNode.ParentNode.ParentNode.Attributes.GetNamedItem("value").Value; string val = metadataFileNode.ParentNode.Attributes.GetNamedItem("value").Value; fileNode.SetDictObject(key1, val); } } printDict(fileNode.fileMetaDict); return(fileNode.fileMetaDict); } //end if (fileNode != null), fileNode built successfully return(null); }
public Dictionary<string, List<string>> lookup(string filename) { filename = filename.Trim(); XmlNodeList metadataFileNodes = doc.SelectNodes("/metadatatable/metadatatype/metadatavalue/file"); foreach (XmlNode metadataFileNode in metadataFileNodes) { //check if the file exsist if (filename.Equals(metadataFileNode.InnerText)) { Debug.WriteLine("found file " + filename); fileNode = new MetaFileNode(filename); break; } } //if exsist if (fileNode != null) { foreach (XmlNode metadataFileNode in metadataFileNodes) { if (filename.Equals(metadataFileNode.InnerText)) { string key1 = metadataFileNode.ParentNode.ParentNode.Attributes.GetNamedItem("value").Value; string val = metadataFileNode.ParentNode.Attributes.GetNamedItem("value").Value; fileNode.SetDictObject(key1, val); } } printDict(fileNode.fileMetaDict); return fileNode.fileMetaDict; } //end if (fileNode != null), fileNode built successfully return null; }
public Dictionary<string, List<string>> lookup(string filename, bool isfullpath) { if (isfullpath) return lookup(filename); filename = filename.Trim(); XmlNodeList metadataFileNodes = doc.SelectNodes("/metadatatable/metadatatype/metadatavalue/file"); foreach (XmlNode metadataFileNode in metadataFileNodes) { //check if the file exsist string full_path = metadataFileNode.InnerText; string file_name = full_path.Split(Path.DirectorySeparatorChar).Last(); if (file_name.Equals(filename)) { fullFileName = full_path; Debug.WriteLine("found file ~~~~~~~~~~~~~~~~~ " + filename); fileNode = new MetaFileNode(filename); break; } } //if exsist if (fileNode != null) { foreach (XmlNode metadataFileNode in metadataFileNodes) { string full_path = metadataFileNode.InnerText; string file_name = full_path.Split(Path.DirectorySeparatorChar).Last(); if (file_name.Equals(filename)) { string key1 = metadataFileNode.ParentNode.ParentNode.Attributes.GetNamedItem("value").Value; string val = metadataFileNode.ParentNode.Attributes.GetNamedItem("value").Value; fileNode.SetDictObject(key1, val); } } printDict(fileNode.fileMetaDict); return fileNode.fileMetaDict; } //end if (fileNode != null), fileNode built successfully return null; }