Click or drag to resize
ActionBuilderStartEditingAction Method
Starts editing the builder's action.

Namespace: Kjs.AppLife.Update.Engine.Core.Design
Assembly: Kjs.AppLife.Update.Engine.Core.Design (in Kjs.AppLife.Update.Engine.Core.Design.dll) Version: 1.0.0.12 (4.0.0.0)
Syntax
public virtual void StartEditingAction(
	IServiceProvider provider
)

Parameters

provider
Type: SystemIServiceProvider
An IServiceProvider that the builder can use to obtain services.
Remarks

A service provider is provided so that the builder can obtain any services needed to start editing.

Currently, the only service provided to edit actions is the IWindowsFormsActionEditorService. This service can be used to display a Control. To create a custom editor, create a class that inherits from Control or UserControl to be used as the editor, then in StartEditingAction(IServiceProvider), obtain a IWindowsFormsActionEditorService and use it to display an instance of your editing control. The control will remain shown until it is destroyed by the service, and should update Action itself as changes are made.

Whenever a change is made to action, the editor should call SetActionDirty to ensure that the UI is notified that the action has changed. It should also call ValidateAction whenever a change is made to the action that might change its validation state.

Examples
The following example demonstrates an implementation of StartEditingAction(IServiceProvider) that uses the IWindowsFormsActionEditorService to edit its action.
public override void StartEditingAction(System.IServiceProvider provider) {
  IWindowsFormsActionEditorService editorService =
    (IWindowsFormsActionEditorService)provider.GetService(typeof(IWindowsFormsActionEditorService));

  if(editorService != null) {
    // MyActionEditorControl has an ActionBuilder property that it uses to call
    // SetActionDirty() and ValidateAction() and to connect to the action that it
    // edits.
    MyActionEditorControl myControl = new MyActionEditorControl();
    myControl.ActionBuilder = this;

    editorService.ShowControl(myControl);
  }
}
See Also