ISqlActivationService.CreateInstance Method

Definition

Initiates an instance of the specified type using the constructor that best matches the specified parameters.

Overloads

CreateInstance<T>()

Creates an instance of the type designated by the specified generic type parameter.

CreateInstance<T>(String)

Indicates the type name of the instance to be created.

CreateInstance<T>(Type)

Indicates the type of instance to be created.

CreateInstance<T>(String, Object[])

Creates an instance of the specified type name using the constructor and arguments passed to the constructor.

CreateInstance<T>(Type, Boolean)

Creates an instance of the specified type using that type's default constructor.

CreateInstance<T>(Type, Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

CreateInstance<T>(Type, Object[], Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo)

Creates an instance of the specified type using the constructor that best matches the specified parameters.

CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo, Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

CreateInstance<T>()

Creates an instance of the type designated by the specified generic type parameter.

public:
generic <typename T>
 T CreateInstance();
public T CreateInstance<T> ();
abstract member CreateInstance : unit -> 'T
Public Function CreateInstance(Of T) () As T

Type Parameters

T

The type of the instance type.

Returns

T

The instance of the type.

Applies to

CreateInstance<T>(String)

Indicates the type name of the instance to be created.

public:
generic <typename T>
 T CreateInstance(System::String ^ typeName);
public T CreateInstance<T> (string typeName);
abstract member CreateInstance : string -> 'T
Public Function CreateInstance(Of T) (typeName As String) As T

Type Parameters

T

The generic Type of value.

Parameters

typeName
String

The instance name.

Returns

T

The type name of the instance to be created.

Applies to

CreateInstance<T>(Type)

Indicates the type of instance to be created.

public:
generic <typename T>
 T CreateInstance(Type ^ type);
public T CreateInstance<T> (Type type);
abstract member CreateInstance : Type -> 'T
Public Function CreateInstance(Of T) (type As Type) As T

Type Parameters

T

The type of this instance.

Parameters

type
Type

The type of an instance.

Returns

T

The type of an instance to be created.

Applies to

CreateInstance<T>(String, Object[])

Creates an instance of the specified type name using the constructor and arguments passed to the constructor.

public:
generic <typename T>
 T CreateInstance(System::String ^ typeName, ... cli::array <System::Object ^> ^ args);
public T CreateInstance<T> (string typeName, params object[] args);
abstract member CreateInstance : string * obj[] -> 'T
Public Function CreateInstance(Of T) (typeName As String, ParamArray args As Object()) As T

Type Parameters

T

The type of the object to create an instance.

Parameters

typeName
String

The name of the preferred type.

args
Object[]

An array of arguments that match in number, order, and type the parameters of the constructor to invoke.

Returns

T

An instance of the specified type name.

Applies to

CreateInstance<T>(Type, Boolean)

Creates an instance of the specified type using that type's default constructor.

public:
generic <typename T>
 T CreateInstance(Type ^ type, bool nonPublic);
public T CreateInstance<T> (Type type, bool nonPublic);
abstract member CreateInstance : Type * bool -> 'T
Public Function CreateInstance(Of T) (type As Type, nonPublic As Boolean) As T

Type Parameters

T

The generic type of value.

Parameters

type
Type

The type of object to create.

nonPublic
Boolean

true if a public or nonpublic default constructor can match; otherwise, false if only a public default constructor can match.

Returns

T

A reference to the newly created object.

Applies to

CreateInstance<T>(Type, Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

public:
generic <typename T>
 T CreateInstance(Type ^ type, ... cli::array <System::Object ^> ^ args);
public T CreateInstance<T> (Type type, params object[] args);
abstract member CreateInstance : Type * obj[] -> 'T
Public Function CreateInstance(Of T) (type As Type, ParamArray args As Object()) As T

Type Parameters

T

The type of the newly created activation service.

Parameters

type
Type

The type of the service.

args
Object[]

An array of arguments that match in number, order, and type the parameters of the constructor to invoke.

Returns

T

A reference to the newly created object.

Applies to

CreateInstance<T>(Type, Object[], Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

public:
generic <typename T>
 T CreateInstance(Type ^ type, cli::array <System::Object ^> ^ args, cli::array <System::Object ^> ^ activationAttributes);
public T CreateInstance<T> (Type type, object[] args, object[] activationAttributes);
abstract member CreateInstance : Type * obj[] * obj[] -> 'T
Public Function CreateInstance(Of T) (type As Type, args As Object(), activationAttributes As Object()) As T

Type Parameters

T

The type of object to create.

Parameters

type
Type

The type of the object to create.

args
Object[]

An array of arguments that match in number, order, and type the parameters of the constructor to invoke.

activationAttributes
Object[]

An array of one or more attributes that can participate in activation. This is typically an array that contains a single UrlAttribute object. The UrlAttribute specifies the URL that is required to activate a remote object.

Returns

T

A reference to the newly created object.

Applies to

CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo)

Creates an instance of the specified type using the constructor that best matches the specified parameters.

public:
generic <typename T>
 T CreateInstance(Type ^ type, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture);
public T CreateInstance<T> (Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture);
abstract member CreateInstance : Type * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> 'T
Public Function CreateInstance(Of T) (type As Type, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo) As T

Type Parameters

T

The type instance.

Parameters

type
Type

The type of object to create.

bindingAttr
BindingFlags

A combination of zero or more bit flags that affect the search for the type constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted.

binder
Binder

An object that uses bindingAttr and args to seek and identify the type constructor.

args
Object[]

An array of arguments that match in number, order, and type the parameters of the constructor to invoke.

culture
CultureInfo

A culture-specific information that governs the coercion of args to the formal types declared for the type constructor.

Returns

T

A reference to the newly created object.

Applies to

CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo, Object[])

Creates an instance of the specified type using the constructor that best matches the specified parameters.

public:
generic <typename T>
 T CreateInstance(Type ^ type, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes);
public T CreateInstance<T> (Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes);
abstract member CreateInstance : Type * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] -> 'T
Public Function CreateInstance(Of T) (type As Type, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object()) As T

Type Parameters

T

The generic value type.

Parameters

type
Type

The type of object to create.

bindingAttr
BindingFlags

A combination of zero or more bit flags that affect the search for the type constructor.

binder
Binder

An object that uses bindingAttr and args to seek and identify the type constructor.

args
Object[]

An array of arguments that match in number, order, and type the parameters of the constructor to invoke.

culture
CultureInfo

Culture-specific information that governs the coercion of args to the formal types declared for the type constructor.

activationAttributes
Object[]

An array of one or more attributes that can participate in activation.

Returns

T

A reference to the newly created object.

Applies to