ComponentChangedEventArgs Classe

Definição

Fornece dados para o evento de ComponentChanged .Provides data for the ComponentChanged event. Essa classe não pode ser herdada.This class cannot be inherited.

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
Herança
ComponentChangedEventArgs
Atributos

Exemplos

O exemplo a seguir demonstra como criar um ComponentChangedEventArgs .The following example demonstrates creating a 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

Comentários

ComponentChangedEventArgs Fornece dados para um ComponentChanged evento.ComponentChangedEventArgs provides data for a ComponentChanged event. O ComponentChanged evento notifica os IComponentChangeService manipuladores de eventos registrados e que um componente específico no documento ativo atualmente foi alterado.The ComponentChanged event notifies the IComponentChangeService and registered event handlers that a particular component in the currently active document has been changed.

Um ComponentChangedEventArgs fornece as seguintes informações:A ComponentChangedEventArgs provides the following information:

  • Uma Component propriedade que indica o componente que foi modificado.A Component property that indicates the component that was modified.

  • Uma Member propriedade que indica o membro que foi alterado.A Member property that indicates the member that was changed.

  • Uma NewValue propriedade que indica o novo valor do membro.A NewValue property that indicates the new value of the member.

  • Uma OldValue propriedade que indica o valor antigo do membro.An OldValue property that indicates the old value of the member.

Os designers de componentes normalmente geram o ComponentChanged evento automaticamente quando os componentes são adicionados, removidos ou modificados.Component designers typically raise the ComponentChanged event automatically when components are added, removed, or modified. Um ComponentChanged evento não é gerado durante o carregamento e o descarregamento do formulário porque são esperadas alterações no momento.A ComponentChanged event is not raised during form load and unload because changes at this time are expected. Um designer de componente pode gerar o ComponentChanged evento depois de alterar uma propriedade do componente; isso garante que o janela Propriedades exibirá a propriedade Updated.A component designer might raise the ComponentChanged event after it changes a property of the component; this ensures that the Properties window will display the updated property.

Notas aos Herdeiros

Ocorrerá um erro de compilador se essa classe for especificada como a classe base de outra classe.A compiler error occurs if this class is specified as the base class of another class.

Construtores

ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Inicializa uma nova instância da classe ComponentChangedEventArgs.Initializes a new instance of the ComponentChangedEventArgs class.

Propriedades

Component

Obtém o componente que foi modificado.Gets the component that was modified.

Member

Obtém o membro que foi alterado.Gets the member that has been changed.

NewValue

Obtém o novo valor do membro alterado.Gets the new value of the changed member.

OldValue

Obtém o valor antigo do membro alterado.Gets the old value of the changed member.

Métodos

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)

Aplica-se a

Confira também