public static IEnumerable <WebConfigSetting> ReadMailSettings(XmlNode document, ParametersGenerationStyle style) { var results = new List <WebConfigSetting>(); var smtpPath = "/configuration/system.net/mailSettings/smtp"; var hostValue = document.SelectSingleNode($"{smtpPath}/network")?.Attributes["host"]?.Value; if (!string.IsNullOrEmpty(hostValue)) { var setting = new WebConfigSetting() { Name = "Smtp.NetworkHost", NodePath = $"{smtpPath}/network/@host", Value = hostValue }; if (style == ParametersGenerationStyle.Tokenize) { setting.Value = TokenizeValue(setting.Name); } results.Add(setting); } var deliveryMethodValue = document.SelectSingleNode($"{smtpPath}")?.Attributes["deliveryMethod"]?.Value; if (!string.IsNullOrEmpty(deliveryMethodValue)) { var setting = new WebConfigSetting() { Name = "Smtp.DeliveryMethod", NodePath = $"{smtpPath}/@deliveryMethod", Value = deliveryMethodValue }; if (style == ParametersGenerationStyle.Tokenize) { setting.Value = TokenizeValue(setting.Name); } results.Add(setting); } return(results); }