public Dictionary<String, GuiMap> LoadGuiMap(String filePath)
{
XmlDocument doc = new XmlDocument();
Dictionary<String, GuiMap> guiObjCollection = null;
try
{
List<string> IdentType = new List<string>();
List<string> Value = new List<string>();
string logicalName = string.Empty;
string identificationType = string.Empty;
string elementValue = string.Empty;
doc.Load(filePath);
XmlNodeList rootNode = doc.DocumentElement.SelectNodes(xmlNodePath);
//Create a dictionary object that can hold key value pairs of string and GUIMap objects
guiObjCollection = new Dictionary<string, GuiMap>();
GuiMap guimap = null;
foreach (XmlNode featureSetNode in rootNode)
{
XmlNodeList elementNodes = featureSetNode.ChildNodes;
foreach (XmlNode node in elementNodes)
{
guimap = new GuiMap();
logicalName = node.Attributes["name"].InnerText;
guimap.LogicalName = logicalName;
XmlNodeList mulNode = node.ChildNodes;
if (node.ChildNodes.Count > 0)
{
foreach (XmlNode nod in mulNode)
{
for (int i = 0; i <= node.ChildNodes.Count - 1; i++)
{
IdentType.Add(node.ChildNodes[i].Name);
Value.Add(node.ChildNodes[i].InnerText);
switch (IdentType[i].ToLower())
{
case id:
guimap.MultIdentities.Add(IdentType[i], Value[i]);
continue;
case text:
guimap.MultIdentities.Add(IdentType[i], Value[i]);
continue;
}
}
break;
}
}
if (!guiObjCollection.ContainsKey(guimap.LogicalName))
{
guiObjCollection.Add(guimap.LogicalName, guimap);
IdentType.Clear();
Value.Clear();
}
}
}
}
catch (FileNotFoundException fne)
{
}
catch (Exception ex)
{
string message = "Exception occured while loading the values" +
"from Gui map xml" + filePath + "not found";
}
return guiObjCollection;
}