ComponentDesigner.InitializeExistingComponent(IDictionary) 方法

定义

重新初始化现有组件。Reinitializes an existing component.

public:
 virtual void InitializeExistingComponent(System::Collections::IDictionary ^ defaultValues);
public virtual void InitializeExistingComponent (System.Collections.IDictionary defaultValues);
abstract member InitializeExistingComponent : System.Collections.IDictionary -> unit
override this.InitializeExistingComponent : System.Collections.IDictionary -> unit
Public Overridable Sub InitializeExistingComponent (defaultValues As IDictionary)

参数

defaultValues
IDictionary

要应用到属性的默认值的名称/值字典。A name/value dictionary of default values to apply to properties. 如果未指定默认值,可能为 nullMay be null if no default values are specified.

实现

注解

重新初始化现有组件时,将调用 InitializeExistingComponent 方法。The InitializeExistingComponent method is called when an existing component is being reinitialized. 例如,在用户将组件拖动到另一个容器后,可能会发生这种情况。For example, this may occur after the user drags a component to another container.

您可以使用 defaultValues 字典将推荐的默认值应用于属性;但是,除了字典中存储的组件属性之外,不应修改组件属性,因为此现有组件可能已设置了属性。You may use the defaultValues dictionary to apply recommended defaults to properties; however, you should not modify component properties aside from those stored in the dictionary, because this existing component may already have properties set on it.

此方法的默认实现不执行任何操作。The default implementation of this method does nothing.

适用于