Partager via


ComponentChangedEventArgs Classe

Définition

Fournit des données pour l'événement ComponentChanged. Cette classe ne peut pas être héritée.

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
Héritage
ComponentChangedEventArgs
Attributs

Exemples

L’exemple suivant illustre la création d’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

Remarques

ComponentChangedEventArgs fournit des données pour un ComponentChanged événement. L’événement ComponentChanged informe les IComponentChangeService gestionnaires d’événements inscrits qu’un composant particulier du document actif a été modifié.

A ComponentChangedEventArgs fournit les informations suivantes :

  • Propriété Component qui indique le composant modifié.

  • Propriété Member qui indique le membre qui a été modifié.

  • Propriété NewValue qui indique la nouvelle valeur du membre.

  • Propriété OldValue qui indique l’ancienne valeur du membre.

Les concepteurs de composants déclenchent généralement l’événement ComponentChanged automatiquement lorsque les composants sont ajoutés, supprimés ou modifiés. Un ComponentChanged événement n’est pas déclenché pendant le chargement et le déchargement du formulaire, car les modifications à ce stade sont attendues. Un concepteur de composants peut déclencher l’événement ComponentChanged une fois qu’il a modifié une propriété du composant ; cela garantit que la fenêtre Propriétés affiche la propriété mise à jour.

Notes pour les héritiers

Une erreur du compilateur se produit si cette classe est spécifiée comme classe de base d’une autre classe.

Constructeurs

Nom Description
ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Initialise une nouvelle instance de la classe ComponentChangedEventArgs.

Propriétés

Nom Description
Component

Obtient le composant qui a été modifié.

Member

Obtient le membre qui a été modifié.

NewValue

Obtient la nouvelle valeur du membre modifié.

OldValue

Obtient l’ancienne valeur du membre modifié.

Méthodes

Nom Description
Equals(Object)

Détermine si l’objet spécifié est égal à l’objet actuel.

(Hérité de Object)
GetHashCode()

Sert de fonction de hachage par défaut.

(Hérité de Object)
GetType()

Obtient la Type de l’instance actuelle.

(Hérité de Object)
MemberwiseClone()

Crée une copie superficielle du Objectactuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l’objet actuel.

(Hérité de Object)

S’applique à

Voir aussi