public string GetElementValue(Dictionary<string, Guimap> guiObjCollection, string logicalName)
{
Guimap tempMap = null;
string elementValue = "";
try
{
if (guiObjCollection.ContainsKey(logicalName))
{
tempMap = guiObjCollection[logicalName];
string identityType = tempMap.IdentificationType;
switch (identityType.ToLower())
{
case id:
elementValue = "id" + tempMap.Id;
break;
case name:
elementValue = "name" + tempMap.Name;
break;
case xpath:
elementValue = "xpath" + tempMap.Xpath;
break;
case classname:
elementValue = "class" + tempMap.ClassName;
break;
case tagname:
elementValue = "tagname" + tempMap.Tagname;
break;
case content:
elementValue = "content" + tempMap.Content;
break;
case atribute:
elementValue = "atribute" + tempMap.Atribute;
break;
default:
throw new GUIException("identifier Not implemented!");
}
}
}
catch (NullReferenceException e)
{
Logger.Error("Exception occured while trying to fetch value from Guimap!");
throw new GUIException("Exception occured while trying to fetch value from Guimap!", e);
}
catch (ArgumentException e)
{
Logger.Error("Exception occured while trying to fetch value from Guimap!");
throw new GUIException("Exception occured while trying to fetch value from Guimap!", e);
}
return elementValue;
}
}