IActivator.CreateInstance Method |
Creates an instance of a give type.
Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
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: ObjectA new instance of type objectType.
For security reasons, implementations should throw an exception or return null if securityToken is nuill.