NuGet.Settings.ReadValue C# (CSharp) Method

ReadValue() private method

private ReadValue ( System.Xml.Linq.XElement element ) : string>.KeyValuePair
element System.Xml.Linq.XElement
return string>.KeyValuePair
        private KeyValuePair<string, string> ReadValue(XElement element)
        {
            var keyAttribute = element.Attribute("key");
            var valueAttribute = element.Attribute("value");

            if (keyAttribute == null || String.IsNullOrEmpty(keyAttribute.Value) || valueAttribute == null)
            {
                throw new InvalidDataException(String.Format(CultureInfo.CurrentCulture, NuGetResources.UserSettings_UnableToParseConfigFile, ConfigFilePath));
            }

            return new KeyValuePair<string, string>(keyAttribute.Value, valueAttribute.Value);
        }