Sdílet prostřednictvím


ComponentChangedEventArgs Třída

Definice

Poskytuje data pro událost ComponentChanged. Tuto třídu nelze zdě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í IComponentChangeService obslužným rutinám událostí a registrovaným obslužným rutinám událostí, že se změnila konkrétní komponenta v aktuálně aktivním dokumentu.

A ComponentChangedEventArgs poskytuje následující informace:

  • Vlastnost Component , která označuje 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 člena.

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

Poznámky pro dědice

K chybě kompilátoru dochází, pokud je tato třída určena jako základní třída jiné třídy.

Konstruktory

Name Description
ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Inicializuje novou instanci ComponentChangedEventArgs třídy.

Vlastnosti

Name Description
Component

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

Member

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

NewValue

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

OldValue

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

Metody

Name Description
Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

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

Slouží jako výchozí funkce hash.

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

Získá Type aktuální instance.

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

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

(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é