SobekCM.Core.Configuration.BriefItemMapping_Configuration.GetMappingSet C# (CSharp) Method

GetMappingSet() public method

Get a brief item mapping set, by set name
public GetMappingSet ( string SetName ) : BriefItemMapping_Set
SetName string Name of the set.
return BriefItemMapping_Set
        public BriefItemMapping_Set GetMappingSet(string SetName)
        {
            // Ensure the dictionary is current
            if ((mappingSetsDictionary == null) || (mappingSetsDictionary.Count != MappingSets.Count))
            {
                if (mappingSetsDictionary == null)
                    mappingSetsDictionary = new Dictionary<string, BriefItemMapping_Set>(StringComparer.OrdinalIgnoreCase);
                else
                    mappingSetsDictionary.Clear();

                foreach (BriefItemMapping_Set thisSet in MappingSets)
                {
                    mappingSetsDictionary[thisSet.SetName] = thisSet;
                }
            }

            // Return the value
            if (mappingSetsDictionary.ContainsKey(SetName))
                return mappingSetsDictionary[SetName];

            return null;
        }