Ejemplo n.º 1
0
 /// <summary>
 /// Looks for first plugin of this type in Plugins.
 /// Reflection performance penalty.
 /// </summary>
 public T GetPlugin <T>() where T : class, IPlugin
 {
     return(Plugins.FirstOrDefault(x => x is T) as T);
 }
Ejemplo n.º 2
0
 public bool HasPlugin <T>() where T : class, IPlugin
 {
     return(Plugins.FirstOrDefault(x => x is T) != null);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Looks for first plugin of this type in Plugins.
 /// Reflection performance penalty.
 /// </summary>
 public TPlugin GetPlugin <TPlugin>() where TPlugin : class, IPlugin
 {
     return(Plugins.FirstOrDefault(x => x is TPlugin) as TPlugin);
 }