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
object
TObject to add.
parent
objectComposite module to which the object should be added.
Returns
- T
The object. You can use this as fluent API.
Type Parameters
T
Type of the
object
.
Exceptions
- ArgumentNullException
Thrown when
parent
is 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
object
TModule to set the name.
name
stringName to set.
force
boolIf 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
T
Type of the
object
.