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.

Data Management<br />

{<br />

// Find the XYZ objects in our workspace by their type.<br />

IEnumerable xyzObjs =<br />

DataManager.Workspace.Find();<br />

}<br />

// Process the objects found.<br />

foreach (XYZObject xyzObj in xyzObjs)<br />

{<br />

...<br />

}<br />

// Method to remove the XYZ objects in our workspace<br />

private void RemoveXYZObjects()<br />

{<br />

// Find the XYZ objects in our workspace by their type.<br />

IEnumerable xyzObjs =<br />

DataManager.Workspace.Find();<br />

}<br />

// Process the objects found.<br />

foreach (XYZObject xyzObj in xyzObjs)<br />

{<br />

DataManager.Workspace.RemoveWorkspaceState(xyzObj);<br />

}<br />

Workspace Events<br />

A module may need to listen to events when the workspace is opened, closed, or is closing<br />

if it needs to save modifications to data. This can be done by providing event handlers for<br />

the DataManager WorkspaceOpened, WorkspaceClosed, and<br />

WorkspaceClosing events. The event definitions are:<br />

public static event EventHandler WorkspaceOpened;<br />

public static event EventHandler WorkspaceClosed;<br />

public static event EventHandler WorkspaceClosing;<br />

3-66 <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!