Class ModuleExtensions
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
ILisrtModuleThe ILisrtModule which should be exited recursively.
throwException
boolIf 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
boolIf 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
ILisrtModuleModule 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
ILisrtModuleModule 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
ILisrtModuleThe 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
ILisrtModuleThe 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
ILisrtModuleThe 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
ILisrtModuleThe ILisrtModule which should be proofed.
Returns
- bool
True if it is the root ILisrtModule instance.