OnQueryRenameFile Method
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

IVsTrackProjectDocuments2.OnQueryRenameFile Method

This method is called by a project to determine whether a file in the project can be renamed.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int OnQueryRenameFile (
	[InAttribute] IVsProject pProject,
	[InAttribute] string pszMkOldName,
	[InAttribute] string pszMkNewName,
	[InAttribute] VSRENAMEFILEFLAGS flags,
	out int pfRenameCanContinue
)
int OnQueryRenameFile (
	/** @attribute InAttribute() */ IVsProject pProject, 
	/** @attribute InAttribute() */ String pszMkOldName, 
	/** @attribute InAttribute() */ String pszMkNewName, 
	/** @attribute InAttribute() */ VSRENAMEFILEFLAGS flags, 
	/** @attribute OutAttribute() */ /** @ref */ int pfRenameCanContinue
)
JScript does not support passing value-type arguments by reference.

Parameters

pProject

[in] Project containing the file to be renamed.

pszMkOldName

[in] Path to the old file name.

pszMkNewName

[in] Path to the new file name.

flags

[in] For a list of flags values, see VSRENAMEFILEFLAGS.

pfRenameCanContinue

[out] This value is true if file renaming can continue.

Return Value

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

COM Signature

From IVsTrackProjectDocuments2.idl

HRESULT IVsTrackProjectDocuments2::OnQueryRenameFile(
   [in] IVsProject *pProject,
   [in] LPCOLESTR pszMkOldName,
   [in] LPCOLESTR pszMkNewName,
   [in] VSRENAMEFILEFLAGS flags,
   [out] BOOL *pfRenameCanContinue
);

Call this method when you want to rename a file in the project. This method must be called before the file is renamed in the project. The environment returns a flag indicating whether the file can be renamed. After you have received authorization to rename the file and you have renamed it, call OnAfterRenameFile to confirm that the file has been renamed and to provide the environment with the new name.

Show:
© 2016 Microsoft