Ejemplo n.º 1
0
 public JavaScriptHostingConfig()
 {
     RequireNativeResolver.Add(getPlugin);     //add default protocol resolver
     ModuleScriptResolver.Add(loadModuleFile); //add default file loader resolver
     ModuleScriptResolver.Add(MODULE_LOADER_PROTOCOL_SDK, (name) =>
     {
         var result = createInstance <ISDKProvider>(name)?.GetSDK();
         if (result == null)
         {
             foreach (var item in PluginLoaders)
             {
                 var tmp = item(name);
                 if (tmp != null)
                 {
                     return(tmp.GetSDK());
                 }
             }
         }
         else
         {
             return(result);
         }
         throw new SDKProviderNotFoundException(name);
     });
 }
Ejemplo n.º 2
0
 public IPluginInstaller LoadPlugin(string name) => RequireNativeResolver.Process(name);