ActivityCodeDomSerializationManager.CreateInstance Method

Definition

Creates an instance of the specified type and adds it to a collection of named instances.

C#
public object CreateInstance(Type type, System.Collections.ICollection arguments, string name, bool addToContainer);

Parameters

type
Type

The data Type to create.

arguments
ICollection

An ICollection of arguments to pass to the constructor for the specified type.

name
String

The name assigned to the resulting object. This name can be used to access the object later through GetInstance(String).

If null is passed, the object is created but cannot be accessed by name.

addToContainer
Boolean

true to add the object to the design container; otherwise, false.

The object must implement IComponent for this to have any effect.

Returns

The newly created object instance.

Implements

Remarks

This provides an indirect reference to the SerializationManager method of the same name.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1