Interface ITypeSource<T>
Interface for a type source that manages objects of a specific type T.
public interface ITypeSource<T> : ITypeSource where T : class
Type Parameters
T
- Inherited Members
- Extension Methods
Methods
Add<TX>(IPlugin, bool)
Add an object to the source of the type TX.
TX? Add<TX>(IPlugin plugin, bool failIfExists = true) where TX : T
Parameters
Returns
- TX
Type Parameters
TX
Add<TX>(IPlugin, TX, bool)
Add an object to the source.
void Add<TX>(IPlugin plugin, TX obj, bool failIfExists = true) where TX : T
Parameters
Type Parameters
TX
ForEach(Action<T>)
Get an object from the source.
void ForEach(Action<T> action)
Parameters
action
Action<T>
Get(Type, bool)
Get an object from the source.
T? Get(Type type, bool required = true)
Parameters
Returns
- T
GetList()
Get all objects from the source.
List<T> GetList()
Returns
- List<T>
GetOrCreate<TX>(IPlugin)
Get an object from the source or create and add if not.
TX GetOrCreate<TX>(IPlugin plugin) where TX : T
Parameters
plugin
IPlugin
Returns
- TX
Type Parameters
TX
Get<TX>(bool)
Get an object from the source.
TX? Get<TX>(bool required = true) where TX : T
Parameters
required
bool
Returns
- TX
Type Parameters
TX
Has<TX>(out TX?)
Do we have an object of the type TX in the source.
bool Has<TX>(out TX? manageable) where TX : T
Parameters
manageable
TX
Returns
Type Parameters
TX
Remove<TX>(IPlugin)
Remove an object from the source.
void Remove<TX>(IPlugin plugin) where TX : T
Parameters
plugin
IPlugin
Type Parameters
TX
Remove<TX>(IPlugin, TX)
Remove an object from the source.
void Remove<TX>(IPlugin plugin, TX obj) where TX : T
Parameters
plugin
IPluginobj
TX
Type Parameters
TX
RequiredType()
Get the type of the object that is required.
Type RequiredType()
Returns
RequiredTypeName()
Get the name of the type that is required.
string RequiredTypeName()
Returns
Select(Func<KeyValuePair<Type, T>, T>)
Select an enumerable of objects from the source.
IEnumerable<T> Select(Func<KeyValuePair<Type, T>, T> selector)
Parameters
selector
Func<KeyValuePair<Type, T>, T>
Returns
- IEnumerable<T>