Читати англійською Редагувати

Поділитися через


IComponentInitializer.InitializeExistingComponent(IDictionary) Method

Definition

Restores an instance of a component to its default state.

C#
public void InitializeExistingComponent(System.Collections.IDictionary? defaultValues);
C#
public void InitializeExistingComponent(System.Collections.IDictionary defaultValues);

Parameters

defaultValues
IDictionary

A dictionary of default property values, which are name/value pairs, with which to reset the component's state.

Remarks

The InitializeExistingComponent method is called when a designer will re-initialize an existing component. For example, InitializeExistingComponent is commonly called after a drag-and-drop operation. The defaultValues parameter is a dictionary containing name/value pairs of default values that should be applied to properties of the associated component. This dictionary may be null if no default values have been specified.

Застереження

When implementing this method, generally you should not modify the component properties beyond those recommendations found in defaultValue. The existing component may already have had its properties set by the user or other design-time code.

Applies to

Продукт Версії
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also