Opc.Ua.Security.SecurityConfigurationManagerFactory.CreateInstance C# (CSharp) Method

CreateInstance() public static method

Returns an instance of the type identified by the assembly qualified name.
public static CreateInstance ( string typeName ) : ISecurityConfigurationManager
typeName string Name of the type.
return ISecurityConfigurationManager
        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;
        }
    }
SecurityConfigurationManagerFactory