Share via


HierarchyRenameEventArgs Class

Definition

Provides data for the OnRenaming(HierarchyRenameEventArgs) and OnRenamed(HierarchyRenameEventArgs) methods. This class cannot be inherited.

public ref class HierarchyRenameEventArgs sealed : EventArgs
public sealed class HierarchyRenameEventArgs : EventArgs
type HierarchyRenameEventArgs = class
    inherit EventArgs
Public NotInheritable Class HierarchyRenameEventArgs
Inherits EventArgs
Inheritance
HierarchyRenameEventArgs

Examples

The following example implements the Microsoft.Web.Management.Client.HierarchyInfo.SupportsRename property, the Microsoft.Web.Management.Client.HierarchyInfo.OnRenamed method, and the Microsoft.Web.Management.Client.HierarchyInfo.OnRenaming method, which implements the <xref:System.Web.Management.Client.HierarchyRenameEventArgs> class. This example enables the user to use the Label property to modify the name of the node.

protected override bool SupportsRename
{
    get
    {
        return true;
    }
}
protected override void OnRenamed(HierarchyRenameEventArgs e)
{
    Trace.WriteLine("Node Name change from: "
        + _sNodeName + " to: " + e.Label);
    _sNodeName = e.Label;
}

Remarks

To rename a page, you must set the Microsoft.Web.Management.Client.HierarchyInfo.SupportsRename property to true.

The Microsoft.Web.Management.Client.HierarchyInfo.OnRenaming method is called when the user starts editing the text of the node. The Microsoft.Web.Management.Client.HierarchyInfo.OnRenamed method is called after the user completes editing the text of the node. A HierarchyRenameEventArgs object specifies the label to change and whether the edit operation has been canceled.

Constructors

HierarchyRenameEventArgs(String)

Initializes a new instance of the HierarchyRenameEventArgs class.

Properties

Cancel

Gets or sets a value indicating whether the rename operation has been canceled.

Label

Gets or sets the new node name that is associated with the page.

Applies to