InstanceFactory.CreateInstance Method
Creates an instance of the specified type.
Namespace: Microsoft.Windows.Design.Model
Assembly: Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)
Syntax
'Declaration
Public Overridable Function CreateInstance ( _
type As Type, _
ParamArray arguments As Object() _
) As Object
'Usage
Dim instance As InstanceFactory
Dim type As Type
Dim arguments As Object()
Dim returnValue As Object
returnValue = instance.CreateInstance(type, _
arguments)
public virtual Object CreateInstance(
Type type,
params Object[] arguments
)
public:
virtual Object^ CreateInstance(
Type^ type,
... array<Object^>^ arguments
)
public function CreateInstance(
type : Type,
... arguments : Object[]
) : Object
Parameters
type
Type: System.TypeThe type of object to create.
arguments
Type: array<System.Object[]An optional array of arguments to pass into the constructor.
Return Value
Type: System.Object
A newly created object. The return value should not return nulla null reference (Nothing in Visual Basic).
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | type is nulla null reference (Nothing in Visual Basic). |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design.Model Namespace