Table of Contents

Class ModuleExtensions

Namespace
Loehnert.Lisrt.Modules
Assembly
Loehnert.Lisrt.Modules.dll

Extensions for ILisrtModule interface.

public static class ModuleExtensions
Inheritance
ModuleExtensions
Inherited Members

Methods

ExitRecursively(ILisrtModule, bool)

Exit the ILisrtModule instance and all SubModules which have the IInitializable interface implemented.

public static bool ExitRecursively(this ILisrtModule module, bool throwException)

Parameters

module ILisrtModule

The ILisrtModule which should be exited recursively.

throwException bool

If false, exceptions thrown in the Exit() method, will be caught and shown (See: ShowException(Exception, ILogger)).

Returns

bool

True, if all IInitializable modules could be exited.

ExitRecursively(IEnumerable<ILisrtModule>, bool)

Exit the ILisrtModule instances and all SubModules which have the IInitializable interface implemented.

public static bool ExitRecursively(this IEnumerable<ILisrtModule> modules, bool throwException)

Parameters

modules IEnumerable<ILisrtModule>

The ILisrtModuleenumeration which should be exited recursively.

throwException bool

If false, exceptions thrown in the Exit() method, will be caught and shown (See: ShowException(Exception, ILogger)).

Returns

bool

True, if all IInitializable modules could be exited.

GetAllModules(ILisrtModule)

Gets an enumeration, that contains the module and all sub modules (recursive).

public static IEnumerable<ILisrtModule> GetAllModules(this ILisrtModule module)

Parameters

module ILisrtModule

Module whose submodules are returned.

Returns

IEnumerable<ILisrtModule>

The enumeration of modules.

GetAllModules<T>(ILisrtModule)

Gets an enumeration, that contains the module and all sub modules (recursive) of type T.

public static IEnumerable<T> GetAllModules<T>(this ILisrtModule module) where T : ILisrtModule

Parameters

module ILisrtModule

Module whose submodules are returned.

Returns

IEnumerable<T>

The enumeration of modules.

Type Parameters

T

Type of modules to get.

GetFullName(ILisrtModule)

Gets the full name of ILisrtModule. Module names are separated by '.'.

public static string GetFullName(this ILisrtModule module)

Parameters

module ILisrtModule

The ILisrtModule with the name.

Returns

string

The full name.

Remarks

E.g. 'root.branch.leaf'.

GetLevel(ILisrtModule)

Gets the level of the module e.g.: 'root.branch.leaf' level of root = 0, level of leaf = 2.

public static int GetLevel(this ILisrtModule module)

Parameters

module ILisrtModule

The ILisrtModule with the searched level.

Returns

int

Level (level of root is 0).

GetRoot(ILisrtModule)

Gets the root module.

public static ILisrtModule GetRoot(this ILisrtModule module)

Parameters

module ILisrtModule

The module which has the root module as parent or parent-parent.

Returns

ILisrtModule

The root module.

IsRoot(ILisrtModule)

Gets a value indicating whether it is the root module of a ILisrtModule tree.

public static bool IsRoot(this ILisrtModule module)

Parameters

module ILisrtModule

The ILisrtModule which should be proofed.

Returns

bool

True if it is the root ILisrtModule instance.