LayoutEditorPart.SyncChanges 方法

定义

WebPart 控件检索属性值并将这些属性值分配给关联 LayoutEditorPart 控件。Retrieves the property values from a WebPart control and assigns them to the associated LayoutEditorPart control.

public:
 override void SyncChanges();
public override void SyncChanges ();
override this.SyncChanges : unit -> unit
Public Overrides Sub SyncChanges ()

注解

SyncChanges方法是控件上的关键方法 LayoutEditorPartThe SyncChanges method is a critical method on a LayoutEditorPart control. 它实现基类中的 SyncChanges 方法,检索关联控件中的当前值 WebPart ,并使用这些值更新控件中的子控件, LayoutEditorPart 以便用户可以对其进行编辑。It implements the SyncChanges method from the base class, retrieves the current values from the associated WebPart control, and updates the child controls in the LayoutEditorPart control with those values so a user can edit them.

SyncChanges只要关联控件中的值发生更改,就会调用方法 WebPartThe SyncChanges method is called whenever the values in the associated WebPart control might have changed. 对于 LayoutEditorPart 控件, EditorZoneBase 包含控件的区域将 SyncChanges 在调用方法之后立即调用方法 ApplyChanges ,以使控件中的值 LayoutEditorPart 始终与关联控件中的值同步 WebPartFor a LayoutEditorPart control, the EditorZoneBase zone that contains the control calls the SyncChanges method immediately after calling the ApplyChanges method, so that the values in the LayoutEditorPart control are always synchronized with the values in the associated WebPart control. 调用方法的另一种情况 SyncChanges 是在 WebPart 控件最初进入编辑模式时。Another case where the SyncChanges method is called is when a WebPart control is initially entering edit mode.

调用方说明

虽然你可以 SyncChanges() 从代码中调用方法,但并不需要这样做。Although you can call the SyncChanges() method from your code, it is not necessary to do so. Web 部件控件集在 ApplyChanges() 编辑过程中的适当时刻调用此方法和方法,以使编辑控件与其关联的控件保持同步 WebPartThe Web Parts control set calls this method and the ApplyChanges() method at the proper times in the editing process to keep editing controls synchronized with their associated WebPart controls.

适用于

另请参阅