CodeElements::CreateUniqueID Method (String^, String^)
Creates a programmatic identifier that does not collide with other identifiers in the scope and that follows the current language naming rules.
Assembly: EnvDTE (in EnvDTE.dll)
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::BooleanA Boolean value indicating true if the name is a unique identifier; otherwise returns false.
Specifies whether or not 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, which is possibly the same characters with no additional characters. The return value, however, always returns whether Prefix is unique or not, regardless of whether or not the second argument is supplied.
Note |
|---|
The values of code model elements such as classes, structs, functions, attributes, delegates, and so forth can be non-deterministic after making certain kinds of edits, meaning that their values cannot be relied upon to always remain the same. For more information, see the section Code Model Element Values Can Change in Discovering Code by Using the Code Model (Visual Basic). |
