Επεξεργασία

Κοινή χρήση μέσω


IComponentChangeService.OnComponentChanged Method

Definition

Announces to the component change service that a particular component has changed.

public:
 void OnComponentChanged(System::Object ^ component, System::ComponentModel::MemberDescriptor ^ member, System::Object ^ oldValue, System::Object ^ newValue);
public void OnComponentChanged (object component, System.ComponentModel.MemberDescriptor member, object oldValue, object newValue);
public void OnComponentChanged (object component, System.ComponentModel.MemberDescriptor? member, object? oldValue, object? newValue);
abstract member OnComponentChanged : obj * System.ComponentModel.MemberDescriptor * obj * obj -> unit
Public Sub OnComponentChanged (component As Object, member As MemberDescriptor, oldValue As Object, newValue As Object)

Parameters

component
Object

The component that has changed.

member
MemberDescriptor

The member that has changed. This is null if this change is not related to a single member.

oldValue
Object

The old value of the member. This is valid only if the member is not null.

newValue
Object

The new value of the member. This is valid only if the member is not null.

Remarks

This method raises the ComponentChanged event.

Most designers that ship with the Windows SDK, as well as the Visual Studio design-time environment, typically raise this event for you when a component in a project is changed, so most of the time you do not need to explicitly call this method. The appropriate IComponentChangeService events are automatically raised when a PropertyDescriptor is used to change a property value or components are added or removed from the IDesignerHost container.

Before calling OnComponentChanged, first call OnComponentChanging to indicate that a component is about to change, and make the change. Then call OnComponentChanged to raise the ComponentChanged event.

Notes to Implementers

This event allows the implementer to do any post-processing that is needed after a property change. For example, a designer typically updates the source code that sets the property with the new value.

Applies to

See also