private string GetSectionName(SettingsContext context) {
string groupName = (string) context["GroupName"];
string key = (string) context["SettingsKey"];
Debug.Assert(groupName != null, "SettingsContext did not have a GroupName!");
string sectionName = groupName;
if (!String.IsNullOrEmpty(key)) {
sectionName = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", sectionName, key);
}
return XmlConvert.EncodeLocalName(sectionName);
}