ComponentChangedEventArgs Clase

Definición

Proporciona datos para el evento ComponentChanged. Esta clase no puede heredarse.

public ref class ComponentChangedEventArgs sealed : EventArgs
public sealed class ComponentChangedEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ComponentChangedEventArgs : EventArgs
type ComponentChangedEventArgs = class
    inherit EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
type ComponentChangedEventArgs = class
    inherit EventArgs
Public NotInheritable Class ComponentChangedEventArgs
Inherits EventArgs
Herencia
ComponentChangedEventArgs
Atributos

Ejemplos

En el ejemplo siguiente se muestra cómo crear un ComponentChangedEventArgs.

public:
   // This example method creates a ComponentChangedEventArgs using the specified arguments.
   // Typically, this type of event args is created by a design mode subsystem.
   ComponentChangedEventArgs^ CreateComponentChangedEventArgs( Object^ component, MemberDescriptor^ member, Object^ oldValue, Object^ newValue )
   {
      // Creates a component changed event args with the specified arguments.
      ComponentChangedEventArgs^ args = gcnew ComponentChangedEventArgs( component, member, oldValue, newValue );
      
      // The component that has changed:              args->Component
      // The member of the component that changed:    args->Member
      // The old value of the member:                 args->oldValue
      // The new value of the member:                 args->newValue
      return args;
   }
// This example method creates a ComponentChangedEventArgs using the specified arguments.
// Typically, this type of event args is created by a design mode subsystem.            
public ComponentChangedEventArgs CreateComponentChangedEventArgs(object component, MemberDescriptor member, object oldValue, object newValue)
{            
    // Creates a component changed event args with the specified arguments.
    ComponentChangedEventArgs args = new ComponentChangedEventArgs(component, member, oldValue, newValue);

    // The component that has changed:              args.Component
    // The member of the component that changed:    args.Member
    // The old value of the member:                 args.oldValue
    // The new value of the member:                 args.newValue

    return args;            
}
' This example method creates a ComponentChangedEventArgs using the specified arguments.
' Typically, this type of event args is created by a design mode subsystem.            
Public Function CreateComponentChangedEventArgs(ByVal component As Object, ByVal member As MemberDescriptor, ByVal oldValue As Object, ByVal newValue As Object) As ComponentChangedEventArgs
    ' Creates a component changed event args with the specified arguments.
    Dim args As New ComponentChangedEventArgs(component, member, oldValue, newValue)

    ' The component that has changed:              args.Component
    ' The member of the component that changed:    args.Member
    ' The old value of the member:                 args.oldValue
    ' The new value of the member:                 args.newValue
    Return args
End Function

Comentarios

ComponentChangedEventArgs proporciona datos para un ComponentChanged evento. El ComponentChanged evento notifica a los controladores de eventos registrados y a los IComponentChangeService que se ha cambiado un componente determinado del documento activo actualmente.

Proporciona ComponentChangedEventArgs la siguiente información:

  • Propiedad Component que indica el componente que se modificó.

  • Propiedad Member que indica el miembro que se cambió.

  • Propiedad NewValue que indica el nuevo valor del miembro.

  • Propiedad OldValue que indica el valor anterior del miembro.

Normalmente, los diseñadores de componentes generan el ComponentChanged evento automáticamente cuando se agregan, quitan o modifican los componentes. No se genera un ComponentChanged evento durante la carga y descarga del formulario porque se esperan cambios en este momento. Un diseñador de componentes puede generar el ComponentChanged evento después de cambiar una propiedad del componente; esto garantiza que el ventana Propiedades mostrará la propiedad actualizada.

Notas a los desarrolladores de herederos

Se produce un error del compilador si esta clase se especifica como la clase base de otra clase.

Constructores

ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Inicializa una nueva instancia de la clase ComponentChangedEventArgs.

Propiedades

Component

Obtiene el componente que se ha modificado.

Member

Obtiene el miembro que se ha cambiado.

NewValue

Obtiene el valor nuevo del miembro que ha cambiado.

OldValue

Obtiene el valor antiguo del miembro que ha cambiado.

Métodos

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Se aplica a

Consulte también