ComponentChangedEventArgs Třída

Definice

Poskytuje data pro událost ComponentChanged. Tato třída se nemůže dědit.

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
Dědičnost
ComponentChangedEventArgs
Atributy

Příklady

Následující příklad ukazuje vytvoření .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

Poznámky

ComponentChangedEventArgs poskytuje data pro ComponentChanged událost. Událost ComponentChanged oznámí a registrovaným IComponentChangeService obslužným rutinám událostí, že došlo ke změně konkrétní součásti v aktuálně aktivním dokumentu.

A ComponentChangedEventArgs poskytuje následující informace:

  • Vlastnost Component označující komponentu, která byla změněna.

  • Vlastnost Member označující člena, který byl změněn.

  • Vlastnost NewValue , která označuje novou hodnotu člena.

  • Vlastnost OldValue , která označuje starou hodnotu členu.

Návrháři komponent obvykle vyvolávají ComponentChanged událost automaticky při přidání, odebrání nebo úpravě komponent. Při ComponentChanged načítání a uvolnění formuláře není vyvolána událost, protože se v tuto chvíli očekávají změny. Návrhář komponent může vyvolat ComponentChanged událost poté, co změní vlastnost komponenty. Tím se zajistí, že okno Vlastnosti zobrazí aktualizovanou vlastnost.

Poznámky pro dědice

K chybě kompilátoru dojde, pokud je tato třída zadána jako základní třída jiné třídy.

Konstruktory

ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Inicializuje novou instanci ComponentChangedEventArgs třídy .

Vlastnosti

Component

Získá komponentu, která byla změněna.

Member

Získá člen, který byl změněn.

NewValue

Získá novou hodnotu změněného člena.

OldValue

Získá starou hodnotu změněného člena.

Metody

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí hashovací funkce.

(Zděděno od Object)
GetType()

Type Získá z aktuální instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Platí pro

Viz také