ComponentRenameEventArgs 类

ComponentRename 事件提供数据。

**命名空间:**System.ComponentModel.Design
**程序集:**System(在 system.dll 中)

语法

声明
<ComVisibleAttribute(True)> _
Public Class ComponentRenameEventArgs
    Inherits EventArgs
用法
Dim instance As ComponentRenameEventArgs
[ComVisibleAttribute(true)] 
public class ComponentRenameEventArgs : EventArgs
[ComVisibleAttribute(true)] 
public ref class ComponentRenameEventArgs : public EventArgs
/** @attribute ComVisibleAttribute(true) */ 
public class ComponentRenameEventArgs extends EventArgs
ComVisibleAttribute(true) 
public class ComponentRenameEventArgs extends EventArgs

备注

ComponentRenameEventArgs 提供有关 ComponentRename 事件的数据。

ComponentRenameEventArgs 对象提供下列信息:

  • Component 属性,它引用被重命名的组件。

  • 指示组件旧名称的 OldName 属性。

  • 指示组件新名称的 NewName 属性。

提示

应用于此类的 HostProtectionAttribute 属性 (Attribute) 具有以下 Resources 属性 (Property) 值:SharedStateHostProtectionAttribute 不影响桌面应用程序(这些应用程序通常通过双击图标、键入命令或在浏览器中输入 URL 来启动)。有关更多信息,请参见 HostProtectionAttribute 类或 SQL Server 编程和宿主保护属性

示例

下面的示例说明如何创建 ComponentRenameEventArgs

' 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
// 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;
}
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;
} //CreateComponentRenameEventArgs

继承层次结构

System.Object
   System.EventArgs
    System.ComponentModel.Design.ComponentRenameEventArgs

线程安全

此类型的任何公共静态(Visual Basic 中的 Shared)成员都是线程安全的,但不保证所有实例成员都是线程安全的。

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

ComponentRenameEventArgs 成员
System.ComponentModel.Design 命名空间
ComponentRename
ComponentRenameEventHandler