PostSharp6.6//API Reference/Post­Sharp.​Serialization Namespace/IActivator Interface/IActivator Methods/IActivator.​Create­Instance Method

IActivator.CreateInstance Method

Creates an instance of a give type.

Namespace:  PostSharp.Serialization
Assembly:  PostSharp (in PostSharp.dll) Version: 6.6.14.0 (6.6.14.0)
Syntax
C#
Object CreateInstance(
	Type objectType,
	ActivatorSecurityToken securityToken
)

Parameters

objectType
Type: System.Type
Type of object whose an instance is requested.
securityToken
Type: PostSharp.Serialization.ActivatorSecurityToken
A security token.

Return Value

Type: Object
A new instance of type objectType.
Remarks

For security reasons, implementations should throw an exception or return null if securityToken is nuill.

See Also