SobekCM.Core.Aggregations.Complete_Item_Aggregation.Get_Setting C# (CSharp) Method

Get_Setting() public method

Gets a setting value, by key
public Get_Setting ( string Key ) : string
Key string Key to look for a match from the settings key/value pairs
return string
        public string Get_Setting(string Key)
        {
            // If the list is undefined, return NULL
            if ((Settings == null) || (Settings.Count == 0))
                return null;

            // Ensure the dictionary was built
            if (settingLookupDictionary == null) settingLookupDictionary = new Dictionary<string, StringKeyValuePair>(StringComparer.OrdinalIgnoreCase);
            if (settingLookupDictionary.Count != Settings.Count)
            {
                foreach (StringKeyValuePair setting in Settings)
                    settingLookupDictionary[setting.Key] = setting;
            }

            // Does this key exist?
            return settingLookupDictionary.ContainsKey(Key) ? settingLookupDictionary[Key].Value : null;
        }