Share via


IManagementHost.CreateBuilder(Type) Method

Definition

Returns the requested object that was created by the class factory and has the specified type.

public:
 System::Object ^ CreateBuilder(Type ^ builderType);
public object CreateBuilder (Type builderType);
abstract member CreateBuilder : Type -> obj
Public Function CreateBuilder (builderType As Type) As Object

Parameters

builderType
Type

The type of the object to be created.

Returns

An object of type builderType that was created by the class factory implementation.

Examples

The following example shows an implementation of the CreateBuilder method.

object IManagementHost.CreateBuilder(Type builderType) {

    if (builderType == typeof(IConnectionBuilder)) {
        return new MyConnectionBuilder();
    }

    if (builderType == typeof(ICredentialBuilder)) {
        return new MyCredentialBuilder();
    }

    if (builderType == typeof(ICertificateVerificationBuilder)) {
        return new MyCertVeriBuilder();
    }

    return null;
} 

Applies to