System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance Method

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

Syntax

public object CreateInstance (Type type, ICollection arguments, string name, bool addToContainer)

Parameters

type
The data type to create.
arguments
The arguments to pass to the constructor for this type.
name
The name of the object. This name can be used to access the object later through IDesignerSerializationManager.GetInstance(string). If null is passed, the object is still created but cannot be accessed by name.
addToContainer
If true, this object is added to the design container. The object must implement System.ComponentModel.IComponent for this to have any effect.

Returns

The newly created object instance.

Remarks

Objects that implement System.ComponentModel.IComponent are added to the design-time container if the addToContainer parameter is true.

Requirements

Namespace: System.ComponentModel.Design.Serialization
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0