ComponentChangedEventArgs Klasa

Definicja

Udostępnia dane dla zdarzenia ComponentChanged. Klasa ta nie może być dziedziczona.

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
Dziedziczenie
ComponentChangedEventArgs
Atrybuty

Przykłady

W poniższym przykładzie pokazano tworzenie elementu 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

Uwagi

ComponentChangedEventArgs dostarcza dane dla ComponentChanged zdarzenia. Zdarzenie ComponentChanged powiadamia IComponentChangeService programy obsługi zdarzeń i zarejestrowane, że określony składnik w aktualnie aktywnym dokumencie został zmieniony.

Element A ComponentChangedEventArgs zawiera następujące informacje:

  • Właściwość Component wskazująca zmodyfikowany składnik.

  • Właściwość Member wskazująca element członkowski, który został zmieniony.

  • Właściwość NewValue wskazująca nową wartość elementu członkowskiego.

  • Właściwość OldValue wskazująca starą wartość elementu członkowskiego.

Projektanci składników zazwyczaj automatycznie zgłaszają ComponentChanged zdarzenie po dodaniu, usunięciu lub zmodyfikowaniu składników. Zdarzenie ComponentChanged nie jest zgłaszane podczas ładowania i zwalniania formularza, ponieważ zmiany w tej chwili są oczekiwane. Projektant składników może zgłosić ComponentChanged zdarzenie po zmianie właściwości składnika. Gwarantuje to, że okno Właściwości wyświetli zaktualizowaną właściwość.

Uwagi dotyczące dziedziczenia

Błąd kompilatora występuje, jeśli ta klasa jest określona jako klasa bazowa innej klasy.

Konstruktory

ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Inicjuje nowe wystąpienie klasy ComponentChangedEventArgs.

Właściwości

Component

Pobiera zmodyfikowany składnik.

Member

Pobiera element członkowski, który został zmieniony.

NewValue

Pobiera nową wartość zmienionego elementu członkowskiego.

OldValue

Pobiera starą wartość zmienionego elementu członkowskiego.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy

Zobacz też