ClientLauncher.IniFiles.GetSectionValues C# (CSharp) Метод

GetSectionValues() публичный Метод

Gets all of the values in a section as a dictionary.
If a section contains more than one key with the same name, this function only returns the first instance. If you need to get all key/value pairs within a section even when keys have the same name, use GetSectionValuesAsList.
/// is a null reference (Nothing in VB) ///
public GetSectionValues ( string sectionName ) : string>.Dictionary
sectionName string /// Name of the section to retrieve values from. ///
Результат string>.Dictionary
        public Dictionary<string, string> GetSectionValues(string sectionName)
        {
            List<KeyValuePair<string, string>> keyValuePairs;
            Dictionary<string, string> retval;

            keyValuePairs = GetSectionValuesAsList(sectionName);

            //Convert list into a dictionary.
            retval = new Dictionary<string, string>(keyValuePairs.Count);

            foreach (KeyValuePair<string, string> keyValuePair in keyValuePairs)
            {
                //Skip any key we have already seen.
                if (!retval.ContainsKey(keyValuePair.Key))
                {
                    retval.Add(keyValuePair.Key, keyValuePair.Value);
                }
            }

            return retval;
        }