ComponentRenameEventArgs 类

定义

ComponentRename 事件提供数据。Provides data for the ComponentRename event.

public ref class ComponentRenameEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class ComponentRenameEventArgs : EventArgs
type ComponentRenameEventArgs = class
    inherit EventArgs
Public Class ComponentRenameEventArgs
Inherits EventArgs
继承
ComponentRenameEventArgs
属性

示例

下面的示例演示如何创建ComponentRenameEventArgsThe following example demonstrates creating a ComponentRenameEventArgs.

public:
   // This example method creates a ComponentRenameEventArgs using the specified arguments.
   // Typically, this type of event args is created by a design mode subsystem.
   ComponentRenameEventArgs^ CreateComponentRenameEventArgs( Object^ component, String^ oldName, String^ newName )
   {
      // The component that was renamed:          args.Component
      // The previous name of the component:      args.OldName
      // The new name of the component:           args.NewName
      return gcnew ComponentRenameEventArgs( component, oldName, newName );
   }
// This example method creates a ComponentRenameEventArgs using the specified arguments.
// Typically, this type of event args is created by a design mode subsystem.  
public ComponentRenameEventArgs CreateComponentRenameEventArgs(object component, string oldName, string newName)
{
    ComponentRenameEventArgs args = new ComponentRenameEventArgs(component, oldName, newName);

    // The component that was renamed:          args.Component
    // The previous name of the component:      args.OldName
    // The new name of the component:           args.NewName            

    return args;
}
' This example method creates a ComponentRenameEventArgs using the specified arguments.
' Typically, this type of event args is created by a design mode subsystem.  
Public Function CreateComponentRenameEventArgs(ByVal component As Object, ByVal oldName As String, ByVal newName As String) As ComponentRenameEventArgs
    Dim args As New ComponentRenameEventArgs(component, oldName, newName)

    ' The component that was renamed:          args.Component
    ' The previous name of the component:      args.OldName
    ' The new name of the component:           args.NewName            

    Return args
End Function

注解

ComponentRenameEventArgs 提供ComponentRename有关事件的数据。A ComponentRenameEventArgs provides data about a ComponentRename event.

ComponentRenameEventArgs对象提供以下信息:A ComponentRenameEventArgs object provides the following information:

  • 引用正在重命名的组件的属性。ComponentA Component property that references the component being renamed.

  • 一个OldName属性, 该属性指示组件的旧名称。An OldName property that indicates the old name of the component.

  • 指示组件的新名称的属性。NewNameA NewName property that indicates the new name of the component.

构造函数

ComponentRenameEventArgs(Object, String, String)

初始化 ComponentRenameEventArgs 类的新实例。Initializes a new instance of the ComponentRenameEventArgs class.

属性

Component

获取所命名的组件。Gets the component that is being renamed.

NewName

获取组件在重命名事件发生后的名称。Gets the name of the component after the rename event.

OldName

获取组件在重命名事件发生前的名称。Gets the name of the component before the rename event.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅