Ejemplo n.º 1
0
 /// <summary>
 /// Importa un delegado que esta a disposicion mediante su tipo
 /// </summary>
 /// <param name="delegate"></param>
 public void ImportApi(Delegate @delegate)
 {
     ApiExports.Add(@delegate);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Invoca un metodo delegado mediante su tipo
 /// </summary>
 /// <typeparam name="TDelegate"></typeparam>
 /// <returns></returns>
 public TDelegate Use <TDelegate>() where TDelegate : Delegate
 {
     return(ApiExports.OfType <TDelegate>().First());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Este metodo conecta plugins que exporten funciones mediantes delegados
 /// </summary>
 public void PlugApi()
 {
     Plug <IPluginApiProvider>(plugin => ApiExports.AddRange(plugin.ExportApi()));
 }