AllowExeDefinitionToEnum(string allowExeDefinition, XmlUtil xmlUtil)
{
switch (allowExeDefinition)
{
case KEYWORD_SECTION_ALLOWDEFINITION_MACHINEONLY:
return ConfigurationAllowExeDefinition.MachineOnly;
case KEYWORD_SECTION_ALLOWDEFINITION_MACHINETOAPPLICATION:
return ConfigurationAllowExeDefinition.MachineToApplication;
case KEYWORD_SECTION_ALLOWEXEDEFINITION_MACHTOROAMING:
return ConfigurationAllowExeDefinition.MachineToRoamingUser;
case KEYWORD_SECTION_ALLOWEXEDEFINITION_MACHTOLOCAL:
return ConfigurationAllowExeDefinition.MachineToLocalUser;
default:
throw new ConfigurationErrorsException(
SR.GetString(SR.Config_section_allow_exe_definition_attribute_invalid),
xmlUtil);
}
}