CodeDomSerializerBase.GetUniqueName Method (IDesignerSerializationManager, Object)


Returns a unique name for the given object.

Namespace:   System.ComponentModel.Design.Serialization
Assembly:  System.Design (in System.Design.dll)

protected string GetUniqueName(
	IDesignerSerializationManager manager,
	object value


Type: System.ComponentModel.Design.Serialization.IDesignerSerializationManager

The IDesignerSerializationManager to use for serialization.

Type: System.Object

The object for which the name will be retrieved.

Return Value

Type: System.String

A unique name for value.

Exception Condition

manager or value is null.

The GetUniqueName method calls the GetName method. If this method does not return a name, then GetUniqueName uses INameCreationService to fabricate a valid name for the object. If the service is not available, GetUniqueName will fabricate a name based on the short type name combined with an index number to make it unique. The resulting name is associated with the serialization manager by calling the SetName method before the new name is returned.

.NET Framework
Available since 2.0
Return to top