Atomia.Provisioning.Modules.Folders.Helpers.Common.GetResourcesForModulePlugin C# (CSharp) Метод

GetResourcesForModulePlugin() публичный статический Метод

public static GetResourcesForModulePlugin ( string moduleName ) : ResourceDescription>.Dictionary
moduleName string
Результат ResourceDescription>.Dictionary
        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;
        }