02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Custom Worksteps<br />

package has changed. It is convenient to pass the argument package and context to the<br />

constructor.<br />

public class MyUpscalingUI : UserControl<br />

{<br />

private MyUpscalingWorkstep.Args args;<br />

private WorkflowContext context;<br />

}<br />

public MyUpscalingUI(MyUpscalingWorkstep.Args argPackage,<br />

WorkflowContext c)<br />

{<br />

this.args = argPackage;<br />

this.context = c;<br />

}<br />

...<br />

You can create your WorkflowEditorUIFactory subclass as a nested class inside your<br />

workstep, athough it is not required. If you want to separate your UI code from your<br />

workflow code you can do so.<br />

using System.Windows.Forms;<br />

class MyUpscalingWorkstep : Workstep<br />

{<br />

...<br />

public class UIFactory : WorkflowEditorUIFactory<br />

{<br />

protected override Control CreateDialogUICore(<br />

Workstep w, object argPkg, WorkflowContext c)<br />

{<br />

return new MyUpscalingUI((MyUpscalingWorkstep.Args)argPkg, c);<br />

}<br />

}<br />

}<br />

In either case, you will override CreateDialogUICore to create your UI and return it to<br />

<strong>Ocean</strong>.<br />

The control you provide will be embedded in an empty dialog shell that <strong>Ocean</strong> provides.<br />

<strong>Schlumberger</strong> Private<br />

Workflow 6-317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!