Class Extensions
Provides static extension methods for working with ILisrtModule implementations.
public static class Extensions
- Inheritance
-
Extensions
- Inherited Members
Methods
TryAddTo<T>(T, object)
Adds a object to a parent
and the parent is a ICompositeModule implementation.
public static T TryAddTo<T>(this T @object, object parent) where T : class
Parameters
objectTObject to add.
parentobjectComposite module to which the object should be added.
Returns
- T
The object. You can use this as fluent API.
Type Parameters
TType of the
object.
Exceptions
- ArgumentNullException
Thrown when
parentis null.
TrySetModuleName<T>(T, string, bool)
Tries to set the Name of the object if it is a ILisrtModule implementation.
public static T TrySetModuleName<T>(this T @object, string name, bool force = false) where T : class
Parameters
objectTModule to set the name.
namestringName to set.
forceboolIf true sets the name, also if the module has already a name.
Returns
- T
The object. You can use this as fluent API.
Type Parameters
TType of the
object.