Condividi tramite


ComponentChangedEventArgs Classe

Definizione

Fornisce i dati per l'evento ComponentChanged. Questa classe non può essere ereditata.

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
Ereditarietà
ComponentChangedEventArgs
Attributi

Esempio

Nell'esempio seguente viene illustrata la creazione di un oggetto 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

Commenti

ComponentChangedEventArgs fornisce dati per un ComponentChanged evento. L'evento ComponentChanged notifica ai IComponentChangeService gestori eventi registrati e che un particolare componente nel documento attualmente attivo è stato modificato.

Un ComponentChangedEventArgs oggetto fornisce le informazioni seguenti:

  • Proprietà Component che indica il componente modificato.

  • Proprietà Member che indica il membro modificato.

  • Proprietà NewValue che indica il nuovo valore del membro.

  • Proprietà OldValue che indica il valore precedente del membro.

Le finestre di progettazione componenti generano in genere automaticamente l'evento ComponentChanged quando vengono aggiunti, rimossi o modificati i componenti. Un ComponentChanged evento non viene generato durante il caricamento del modulo e lo scaricamento perché le modifiche in questo momento sono previste. Una finestra di progettazione componenti potrebbe generare l'evento ComponentChanged dopo la modifica di una proprietà del componente. In questo modo, la finestra Proprietà visualizzerà la proprietà aggiornata.

Note per gli eredi

Se questa classe viene specificata come classe base di un'altra classe, si verifica un errore del compilatore.

Costruttori

Nome Descrizione
ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Inizializza una nuova istanza della classe ComponentChangedEventArgs.

Proprietà

Nome Descrizione
Component

Ottiene il componente modificato.

Member

Ottiene il membro modificato.

NewValue

Ottiene il nuovo valore del membro modificato.

OldValue

Ottiene il valore precedente del membro modificato.

Metodi

Nome Descrizione
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a

Vedi anche