public static Dictionary<string, ResourceDescription> GetResourcesForModulePlugin(string moduleName)
{
Dictionary<string, ResourceDescription> resources = new Dictionary<string, ResourceDescription>();
string resourcesFilePath = AppDomain.CurrentDomain.BaseDirectory.Replace("Modules\\", "");
resourcesFilePath = resourcesFilePath + "resources.xml";
//for testing from code this path must be set through code
//resourcesFilePath = "c:\\Program Files (x86)\\Atomia\\AutomationServer\\Common\\resources.xml";
System.Xml.Linq.XDocument xmlDoc = null;
try
{
xmlDoc = System.Xml.Linq.XDocument.Load(resourcesFilePath);
}
catch (Exception ex)
{
throw ExceptionHelper.GetModuleException("ID422004", null, ex);
}
if (xmlDoc == null)
{
}
else
{
foreach (System.Xml.Linq.XElement resourceAndPolicy in xmlDoc.Root.Elements("bindings"))
{
resources = FillBindingsElement(resourceAndPolicy, moduleName);
}
}
return resources;
}