FileNode.SetEditLabel Method (String)

Sets the editable name of the file with the given name.

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

Syntax

'宣言
Public Overrides Function SetEditLabel ( _
    label As String _
) As Integer
'使用
Dim instance As FileNode
Dim label As String
Dim returnValue As Integer

returnValue = instance.SetEditLabel(label)
public override int SetEditLabel(
    string label
)
public:
virtual int SetEditLabel(
    String^ label
) override
public override function SetEditLabel(
    label : String
) : int

Parameters

Return Value

Type: System.Int32

Returns S_FALSE if the new name is the same as the old one; otherwise returns S_OK.

Exceptions

Exception Condition
E_FAIL

The project is null or closed.

[System.InvalidOperationException]

The file name string is null, empty, or invalid.

-or-

A file already exists on disk at the same location.

Remarks

This method first ensures that the file name is valid and that there is no file with the same name and path. It then checks whether the file's extension has been changed, and if so displays a message box confirming the change of extension. If the user cancels the confirmation, the method returns S_OK. Otherwise it builds the relative path and calls [SetEditLabel(string label, string strRelPath)].

Permissions

See Also

Reference

FileNode Class

FileNode Members

SetEditLabel Overload

Microsoft.VisualStudio.Package Namespace