DesignerSerializationManager.IDesignerSerializationManager.SetName Method
Sets the name for the specified object.
Namespace: System.ComponentModel.Design.Serialization
Assembly: System.Design (in System.Design.dll)
Parameters
- instance
- Type: System.Object
The object to set the name.
- name
- Type: System.String
A String used as the name of the object.
Implements
IDesignerSerializationManager.SetName(Object, String)| Exception | Condition |
|---|---|
| ArgumentNullException | One or both of the parameters are null. |
| ArgumentException | The object specified by instance already has a name, or name is already used by another named object. |
| InvalidOperationException | This property was accessed outside of a serialization session. |
The IDesignerSerializationManager.SetName method provides a way to set the name of an existing object. This enables creation of an instance of the object through a call to the IDesignerSerializationManager.GetInstance method, avoiding the overhead of the CreateInstance method.
- 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.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.