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 Processes<br />

The process is deactivated when another process is activated. Override<br />

OnDeactivateCore to properly shut down your process. In our example we remove the<br />

toolbar button:<br />

protected override void OnDeactivateCore()<br />

{<br />

base.OnDeactivateCore();<br />

PetrelSystem.Tools.Remove(myButton);<br />

}<br />

}<br />

Step 5 – Optionally Handle Window Modes<br />

To interact with the native Petrel windows, use the window mode properties:<br />

public abstract class Process<br />

{<br />

...<br />

protected virtual IEnumerable WindowModesCore;<br />

public IEnumerable WindowModes { get; }<br />

}<br />

Typically, this list is managed in the process activation and deactivation. For details, see<br />

“Interaction in Petrel Windows” in Volume 3, “Petrel Customization” in Chapter 2, “User<br />

Interface Services.”<br />

Step 6 - Implement Persistence<br />

When your custom UI takes end user input, the Petrel convention is to save the previously<br />

entered values and display them again the next time the process is run. This is so the end<br />

user does not have to re-enter the same inputs over and over again.<br />

Implement persistence for your custom UI with one of these two methods:<br />

• Implementing IIdentifiable<br />

• Serialization<br />

The recommendation is not to persist the UI but to create a simple nested class containing<br />

the pertinent information and persist that instead.<br />

Both methods are described in “IPresentation” in Volume 3, “Petrel Customization” in<br />

Chapter 2, “User Interface Services.”<br />

6-332 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!