Export (0) Print
Expand All

IComponentChangeService.OnComponentChanged Method

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

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft