string GetBase(IniFileSetting setting)
{
switch (File.Behavior.Duplicates) {
case IniFileDuplicateBehavior.Abort:
case IniFileDuplicateBehavior.AllowChooseFirst:
case IniFileDuplicateBehavior.AllowChooseLast:
case IniFileDuplicateBehavior.IgnoreChooseFirst:
case IniFileDuplicateBehavior.IgnoreChooseLast:
return setting.Value;
case IniFileDuplicateBehavior.AllowAll:
if (setting.NextSettingWithSameName != null)
throw new Exception("There are multiple settings in this section with the same name. As such, this setting cannot be accessed individually.");
return setting.Value;
default:
throw new Exception();
}
}