Skip to content

M_CodeJam_Reflection_ReflectionExtensions_CreateInstance

Andrew Koryavchenko edited this page Jul 4, 2017 · 5 revisions

ReflectionExtensions.CreateInstance Method

Creates instance of type with specified parameters.

Namespace: CodeJam.Reflection
Assembly: CodeJam (in CodeJam.dll) Version: 1.1.0.0 (1.1.0.0)

Syntax

C#

public static Object CreateInstance(
	this Type type,
	params ParamInfo[] parameters
)

VB

<ExtensionAttribute>
Public Shared Function CreateInstance ( 
	type As Type,
	ParamArray parameters As ParamInfo()
) As Object

F#

[<ExtensionAttribute>]
static member CreateInstance : 
        type : Type * 
        parameters : ParamInfo[] -> Object 

Parameters

 

type
Type: System.Type
Type to create instance.
parameters
Type: CodeJam.Reflection.ParamInfo[]
Constructor parameters

Return Value

Type: Object
Instance of type

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

 

Exception Condition
ArgumentNullException type is null
ArgumentException No suitable constructors found

See Also

Reference

ReflectionExtensions Class
CodeJam.Reflection Namespace

Clone this wiki locally