public static ISecurityConfigurationManager CreateInstance(string typeName)
{
if (String.IsNullOrEmpty(typeName))
{
return new SecurityConfigurationManager();
}
Type type = Type.GetType(typeName);
if (type == null)
{
throw ServiceResultException.Create(
StatusCodes.BadNotSupported,
"Cannot load type: {0}",
typeName);
}
ISecurityConfigurationManager configuration = Activator.CreateInstance(type) as ISecurityConfigurationManager;
if (configuration == null)
{
throw ServiceResultException.Create(
StatusCodes.BadNotSupported,
"Type does not support the ISecurityConfigurationManager interface: {0}",
typeName);
}
return configuration;
}
}