ProjectNode.CanOverwriteExistingItem Method

Determines whether or not a file can be overwritten.

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

Syntax

'宣言
Protected Overridable Function CanOverwriteExistingItem ( _
    originalFileName As String, _
    computedNewFileName As String _
) As Integer
'使用
Dim originalFileName As String
Dim computedNewFileName As String
Dim returnValue As Integer

returnValue = Me.CanOverwriteExistingItem(originalFileName, _
    computedNewFileName)
protected virtual int CanOverwriteExistingItem(
    string originalFileName,
    string computedNewFileName
)
protected:
virtual int CanOverwriteExistingItem(
    String^ originalFileName, 
    String^ computedNewFileName
)
protected function CanOverwriteExistingItem(
    originalFileName : String, 
    computedNewFileName : String
) : int

Parameters

  • originalFileName
    Type: System.String

    The name of the file to overwrite.

  • computedNewFileName
    Type: System.String

    The new name of the file.

Return Value

Type: System.Int32

E_ABORT if the document is open; OLECMDERR_E_CANCELED() if the confirmation message box was canceled; otherwise S_OK.

Remarks

This method displays a message box and returns if the file is open. It also displays a method box if the file already exists in the project, asking for confirmation of the name.

Permissions

See Also

Reference

ProjectNode Class

ProjectNode Members

Microsoft.VisualStudio.Package Namespace