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

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

behavior could be restricted access to data, visual cues in the UI of the 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 />

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

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

{<br />

...<br />

}<br />

}<br />

// Get 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 />

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

ModuleTrust opTrust =<br />

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

// Get 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 may be provided by the module appearance by<br />

implementing IModuleAppearance.<br />

public interface IModuleAppearance<br />

{<br />

string Description { get; }<br />

string DisplayName { get; }<br />

string ImageResourceName { get; }<br />

Uri ModuleUri { get; }<br />

}<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!