//Appends the any xml file/folder nodes onto the folder
private void AddXmlNodes(FolderCompareObject folder, int numOfPaths, XmlDocument xmlDoc)
{
List<XMLCompareObject> xmlObjList = new List<XMLCompareObject>();
List<string> xmlFolderList = new List<string>();
for (int i = 0; i < numOfPaths; i++)
{
string path = Path.Combine(folder.GetSmartParentPath(i), folder.Name);
if (Directory.Exists(path))
{
DirectoryInfo dirInfo = new DirectoryInfo(path);
FileInfo[] fileList = dirInfo.GetFiles();
DirectoryInfo[] dirInfoList = dirInfo.GetDirectories();
string xmlPath = Path.Combine(path, CommonXMLConstants.MetadataPath);
if (!File.Exists(xmlPath))
continue;
CommonMethods.LoadXML(ref xmlDoc, xmlPath);
xmlObjList = GetAllFilesInXML(xmlDoc);
xmlFolderList = GetAllFoldersInXML(xmlDoc);
RemoveSimilarFiles(xmlObjList, fileList);
RemoveSimilarFolders(xmlFolderList, dirInfoList);
}
AddFileToChild(xmlObjList, folder, i, numOfPaths);
AddFolderToChild(xmlFolderList, folder, i, numOfPaths);
xmlObjList.Clear();
xmlFolderList.Clear();
}
}