IComponentChangeService.OnComponentChanged Method (Object, MemberDescriptor, Object, Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.ComponentModel.Design
Assembly:  System (in System.dll)

void OnComponentChanged(
	object component,
	MemberDescriptor member,
	object oldValue,
	object newValue


Type: System.Object

The component that has changed.

Type: System.ComponentModel.MemberDescriptor

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

Type: System.Object

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

Type: System.Object

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

This method raises the ComponentChanged event.

Most designers that ship with the Windows Software Development Kit (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.

.NET Framework
Available since 1.1
Return to top