Generates a unique document name for a given project item.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Public Overridable Function GenerateUniqueItemName ( _
itemIdLoc As UInteger, _
ext As String, _
suggestedRoot As String, _
<OutAttribute> ByRef itemName As String _
) As Integer
'使用
Dim instance As ProjectNode
Dim itemIdLoc As UInteger
Dim ext As String
Dim suggestedRoot As String
Dim itemName As String
Dim returnValue As Integer
returnValue = instance.GenerateUniqueItemName(itemIdLoc, _
ext, suggestedRoot, itemName)
public virtual int GenerateUniqueItemName(
uint itemIdLoc,
string ext,
string suggestedRoot,
out string itemName
)
public:
virtual int GenerateUniqueItemName(
unsigned int itemIdLoc,
String^ ext,
String^ suggestedRoot,
[OutAttribute] String^% itemName
)
public function GenerateUniqueItemName(
itemIdLoc : uint,
ext : String,
suggestedRoot : String,
itemName : String
) : int
Parameters
itemIdLoc
Type: System.UInt32Containing folder for the unique item name being generated. Should be a valid item identifier, such an VSITEMID_ROOT.
ext
Type: System.StringFile extension of the new document name
suggestedRoot
Type: System.StringIf not a null reference (Nothing in Visual Basic) or empty, this value is used as the base name for the item, and numbers should be appended to make the name unique. If supplied, the project makes up its own root name based on the ext file extension.
itemName
Type: System.String%Specifies the new item name, which contains the name only, not the item's file path.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Implements
IVsProject3.GenerateUniqueItemName(UInt32, String, String, String%)
IVsProject2.GenerateUniqueItemName(UInt32, String, String, String%)
IVsProject.GenerateUniqueItemName(UInt32, String, String, String%)
Permissions
- 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.