Changes

HowTo:Create UBIK Module

3,384 bytes added, 12:08, 3 August 2016
Created page with "{{UBIK}} Modules are loaded dynamically into the {{UBIK}} Kernel by the {{UBIK}} [[Injection_Management|Injection Management]] based on the [https://msdn.microsoft.com/de-de/l..."
{{UBIK}} Modules are loaded dynamically into the {{UBIK}} Kernel by the {{UBIK}} [[Injection_Management|Injection Management]] based on the [https://msdn.microsoft.com/de-de/library/dd460648%28v=vs.110%29.aspx Microsoft Extensibility Framework (MEF)].

= Introduction =
=== Basic Prerequisites ===
Creating an own plugin requires to add references to
* System.ComponentModel.Composition
* UBIK.Injection

{{UBIK}} Injection Management provides access to all the basic features used by the Kernel to identifiy and categorize the available plugins. This management is provided by a library called '''UBIK.Injection'''.

=== Interface: IUbikModule ===
The module must implement the <code>UBIK.Injection.IUbikModule</code> interface and has to be registered for MEF composition by defining the export contract via an attribute.
<source lang="csharp">
[Export(typeof(UBIK.Injection.IUbikModule))]

public class TestModule : UBIK.Injection.IUbikModule
{
}
</source>

=== Interface: IUbikInjectionMetaData ===
Managing modules correctly presumes the following information, as defined by the interface <code>UBIK.Injection.IUbikInjectionMetaData</code>.

<source lang="csharp">
[ExportMetadata("ID", "C149402E-BC86-46D6-8D1B-63C86894EA77")]
[ExportMetadata("Type", typeof(TestModule))]
[ExportMetadata("Name", "TestModule" )]
[ExportMetadata("Description", "Tests the injection management")]
[ExportMetadata("Version", 1)]
[ExportMetadata("Company", "Augmensys GmbH")]
</source>

==== Mandatory information ====
{| class="wikitable" | width = "100%"
|-
! Name !! Type !! Description
|-
| ID|| {{MSDN/String}} || Unique ID of the module
|-
| Type|| System.Type || Systemtype of the module; used for filtering the module during loading.
|-
|}

==== Optional information ====
{| class="wikitable" | width = "100%"
|-
! Name !! Type !! Description
|-
| Name|| {{MSDN/String}} || Name of the module (for UI Presentation)
|-
| Description|| {{MSDN/String}} || Descrirption of the module (for UI Presentation)
|-
| Version|| {{MSDN/Int32}} || Version of the module. As there are more modules with the same ID, only the module with the highest Version is available.
|-
| TargetApplication|| PluginTargetApplication|| Possibility to limit the module for a single type of application.
|-
| MinimumKernelVersion|| {{MSDN/String}} || Minimum required Kernel version: Format x.x.x.x
|-
| MinimumDatabaseVersion|| {{MSDN/String}} || Minimum required Database version: Format x.x.x.x
|-
| Company|| {{MSDN/String}} || Information about the Company (for UI Presentation)
|-
| Copyright|| {{MSDN/String}} || Copyright Information (for UI Presentation)
|-
|}

= Example =
<source lang="csharp">
[Export(typeof(UBIK.Injection.IUbikModule))]
[ExportMetadata("ID", "C149402E-BC86-46D6-8D1B-63C86894EA77")]
[ExportMetadata("Type", typeof(TestPlugin))]
[ExportMetadata("Name", "TestModule" )]
[ExportMetadata("Description", "Tests the injection management")]
[ExportMetadata("Version", 1)]
[ExportMetadata("MinimumKernelVersion", "2.4.0.0")]
[ExportMetadata("MinimumDatabaseVersion", "2.4.0.0")]
[ExportMetadata("Company", "Augmensys GmbH")]
[ExportMetadata("Copyright", "2014, Augmensys GmbH")]

public class TestModule : UBIK.Injection.IUbikModule
{

}
</source>

<headertabs />

== See also ==
* [[Injection_Management]]
10,686
edits