ComponentChangedEventArgs Kelas

Definisi

Menyediakan data untuk peristiwa tersebut ComponentChanged . Kelas ini tidak dapat diwariskan.

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
Warisan
ComponentChangedEventArgs
Atribut

Contoh

Contoh berikut menunjukkan pembuatan 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

Keterangan

ComponentChangedEventArgs menyediakan data untuk ComponentChanged suatu peristiwa. Kejadian ini ComponentChanged memberi tahu IComponentChangeService dan penangan peristiwa terdaftar bahwa komponen tertentu dalam dokumen yang saat ini aktif telah diubah.

menyediakan ComponentChangedEventArgs informasi berikut:

  • Properti Component yang menunjukkan komponen yang dimodifikasi.

  • Properti Member yang menunjukkan anggota yang diubah.

  • Properti NewValue yang menunjukkan nilai baru anggota.

  • Properti OldValue yang menunjukkan nilai lama anggota.

Perancang komponen biasanya menaikkan ComponentChanged peristiwa secara otomatis saat komponen ditambahkan, dihapus, atau dimodifikasi. Peristiwa ComponentChanged tidak dinaikkan selama pemuatan dan pembongkaran formulir karena perubahan saat ini diharapkan. Perancang komponen mungkin menaikkan ComponentChanged peristiwa setelah mengubah properti komponen; ini memastikan bahwa jendela Properti akan menampilkan properti yang diperbarui.

Catatan Bagi Inheritor

Kesalahan pengkompilasi terjadi jika kelas ini ditentukan sebagai kelas dasar kelas lain.

Konstruktor

ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object)

Menginisialisasi instans baru kelas ComponentChangedEventArgs.

Properti

Component

Mendapatkan komponen yang dimodifikasi.

Member

Mendapatkan anggota yang telah diubah.

NewValue

Mendapatkan nilai baru anggota yang diubah.

OldValue

Mendapatkan nilai lama dari anggota yang diubah.

Metode

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan dari instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk

Lihat juga