pGina.Shared.Settings.pGinaDynamicSettings.GetSubSettings C# (CSharp) Method

GetSubSettings() public static method

Get a dictionary containing all sub-keys of the plugin's registry key. The Dictionary key is the sub-key name, the value is a pGinaDynamicSettings object corresponding to the sub-key.
public static GetSubSettings ( System.Guid pluginGuid ) : dynamic>.Dictionary
pluginGuid System.Guid The plugin Guid.
return dynamic>.Dictionary
        public static Dictionary<string, dynamic> GetSubSettings(Guid pluginGuid)
        {
            Dictionary<string, dynamic> result = new Dictionary<string, dynamic>();

            string subKey = string.Format(@"{0}\Plugins\{1}", pGinaRoot, pluginGuid.ToString());
            using( RegistryKey key = Registry.LocalMachine.OpenSubKey(subKey, false) )
            {
                if (key != null)
                {
                    string[] names = key.GetSubKeyNames();
                    foreach (string n in names)
                    {
                        result.Add(n, new pGinaDynamicSettings(pluginGuid, n));
                    }
                }
            }

            return result;
        }