02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - 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 />

// create a ModuleTrust from the namespace, type, assembly string<br />

ModuleTrust mt = new ModuleTrust(moduleTrustName);<br />

// add the ModuleTrust to the known trust<br />

CoreSystem.Modules.AddModuleTrust(mt);<br />

}<br />

}<br />

// add the modules in the collection to the known modules<br />

CoreSystem.AddModules(col, moduleTrustName);<br />

Private void CoreSystemStateChanged(object sender,<br />

SystemStateEventArgs e)<br />

{<br />

// Make sure we’re beyond IntegratePresentation.<br />

if (e.State.Equals(SystemState.Running))<br />

{<br />

// we assume we’ve added a moduletrust for our purposes<br />

// earlier, perhaps in the configuration file<br />

string demoTrustName = "DemoModuleTrust";<br />

// create a collection to hold the module<br />

ModuleReferenceCollection col = new ModuleReferenceCollection();<br />

// add our module to the collection using the assembly<br />

// qualified typename<br />

string moduleName = "Demo.MyModule, MyModuleAssembly";<br />

col.AddModule(moduleName);<br />

}<br />

}<br />

// add the modules in the collection to the known modules,<br />

// and place them in the moduletrust named “DemoModuleTrust”<br />

CoreSystem.AddModules(col, demoTrustName);<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!