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.

The <strong>Ocean</strong> Module<br />

components will be displayed when the rest of the user interface is rendered or when they<br />

are called to display by the application.<br />

public class MyModule : IModule<br />

{<br />

...<br />

// Add to user interface of product family.<br />

// Add a button to Insert menu.<br />

public IntegratePresentation ()<br />

{<br />

// Define the button to add<br />

ToolbarItem btn = new ToolbarItem(WellKnownUI.Menus.Insert,<br />

“MyButton”, ButtonClick);<br />

// Add the button to the Insert menu of the Petrel menubar.<br />

PetrelSystem.Tools.Add(btn);<br />

// Add a context menu for a surface<br />

ContextMenuItem surf =<br />

new contextMenuItem("Surface", SurfClick);<br />

...<br />

}<br />

...<br />

}<br />

When the IntegratePresentation method has been completed for all of the<br />

modules, the product will be in a running state. The modules services and processes are<br />

available for use from the menu bar or other user interface component where they were<br />

installed.<br />

Disintegrate<br />

The IModule Disintegrate method is called on each module when the product family<br />

begins to shut down. Disintegrate has the responsibility of cleaning up any<br />

presentation elements installed by the module. It should also sever any connections with<br />

other modules. From the context menu example in the code snippet in<br />

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

<strong>Ocean</strong> Core 3-31

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

Saved successfully!

Ooh no, something went wrong!