This documentation is archived and is not being maintained.

ProjectNode.GenerateUniqueItemName Method

Visual Studio 2005

Generates a unique document name for a given project item.

This method is not CLS-compliant.  

Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in mpf.project.nonshipping.dll)

public virtual int GenerateUniqueItemName (
	uint itemIdLoc,
	string ext,
	string suggestedRoot,
	out string itemName
)
public int GenerateUniqueItemName (
	UInt32 itemIdLoc, 
	String ext, 
	String suggestedRoot, 
	/** @attribute OutAttribute() */ /** @ref */ String itemName
)
JScript does not support passing value-type arguments by reference.

Parameters

itemIdLoc

Containing folder for the unique item name being generated. Should be a valid item identifier, such an VSITEMID_ROOT.

ext

File extension of the new document name

suggestedRoot

If 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

Specifies the new item name, which contains the name only, not the item's file path.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Show: