VCCodeElements::CreateUniqueID Method (String^, String^)

 

Creates a programmatic identifier that does not collide with other identifiers in the scope, and follows the current language naming rules. This method is not implemented in Visual C#.

Namespace:   Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

bool CreateUniqueID(
	String^ Prefix,
	String^% NewName = "0"
)

Parameters

Prefix
Type: System::String^

Required. The prefix string or whole name to check to see whether or not it is unique for the collection of code elements.

NewName
Type: System::String^

Optional. If supplied, this returns with a guaranteed unique name.

Return Value

Type: System::Boolean

true if the name is a unique identifier, false if it is not.

CreateUniqueID returns whether Prefix is a unique identifier in the collection of code elements. If the second argument, NewName, is supplied, then it returns a unique name based on Prefix as a prefix (possibly the same characters with no additional characters). The return value, however, always returns whether Prefix is unique, regardless of whether the second argument is supplied.

Return to top
Show: