02.05.2014 Views

Ocean* Application Development Framework - Ocean - Schlumberger

Ocean* Application Development Framework - Ocean - Schlumberger

Ocean* Application Development Framework - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Product families (e.g., Petrel) can attach behavior to ModuleTrust membership.<br />

Such behavior could be restricted access to data, visual cues in the UI of the<br />

module, etc.<br />

using Slb.<strong>Ocean</strong>.Core;<br />

using Slb.<strong>Ocean</strong>.Core;<br />

...<br />

// Find all module trusts<br />

foreach (ModuleTrust trust in CoreSystem.Modules.ModuleTrusts)<br />

{<br />

// the public key token. If null, then we have a weak key.<br />

if (trust.PublicKeyToken != null)<br />

{<br />

...<br />

}<br />

}<br />

// the module trust for the Hello<strong>Ocean</strong>Module module.<br />

ModuleTrust homTrust =<br />

CoreSystem.Modules.GetModuleTrust(typeof(Hello<strong>Ocean</strong>Module));<br />

// the <strong>Ocean</strong>Petrel module trust.<br />

ModuleTrust opTrust =<br />

CoreSystem.Modules.GetModuleTrust(“<strong>Ocean</strong>Petrel”);<br />

// the module references contained in a module trust<br />

ModuleReferenceCollection col =<br />

CoreSystem.Modules.GetModuleTrustGroup(opTrust);<br />

...<br />

Module Appearance<br />

The identity, or branding, of a module can be provided by the module appearance by<br />

implementing IModuleAppearance.<br />

public interface IModuleAppearance<br />

{<br />

string Description { ; }<br />

string DisplayName { ; }<br />

string ImageResourceName { ; }<br />

Uri ModuleUri { ; }<br />

}<br />

IModuleAppearance allows you to control the descriptive information, name,<br />

icon, and uniform resource identifier (URI) for the module. It is linked to the module<br />

through the ModuleAppearance attribute, so it is usually implemented by a<br />

separate class.<br />

<strong>Schlumberger</strong> Private - Customer Use<br />

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

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

Saved successfully!

Ooh no, something went wrong!