Compartir a través de


VCCodeElements.CreateUniqueID(String, String) Method

Definition

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#.

bool CreateUniqueID(std::wstring const & Prefix, [Runtime::InteropServices::Out] std::wstring const & & NewName = 0);
[System.Runtime.InteropServices.DispId(5)]
public bool CreateUniqueID (string Prefix, out string NewName = 0);
[System.Runtime.InteropServices.DispId(5)]
public bool CreateUniqueID (string prefix, out string newName);
[<System.Runtime.InteropServices.DispId(5)>]
abstract member CreateUniqueID : string * string -> bool
Public Function CreateUniqueID (Prefix As String, Optional ByRef NewName As String = 0) As Boolean
Public Function CreateUniqueID (prefix As String, ByRef newName As String) As Boolean

Parameters

Prefixprefix
String

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

NewNamenewName
String

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

Returns

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

Implements

Attributes

Remarks

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.

Applies to