Пример #1
0
 public static T1 Load <T1, T2>(T2 baseApi, SearchPathContainer paths = null)
     where T1 : NativeExtension <T2> where T2 : NativeAPI
 {
     CreateBuilder <T2>();
     return(baseApi.IsExtensionPresent(GetExtensionAttribute(typeof(T1)).Name)
         ? _builders[typeof(T2)].ActivateClass <T1>((paths ?? baseApi.SearchPaths).GetLibraryName())
         : null);
 }
Пример #2
0
        public static T1 Load <T1, T2>(T2 baseApi, SearchPathContainer paths, ISymbolLoader loader)
            where T1 : NativeExtension <T2> where T2 : NativeAPI
        {
            var builder = new NativeLibraryBuilder(Options).WithSymbolLoader(x => loader ?? x);
            var extAttr = GetExtensionAttribute(typeof(T1));

            return(baseApi.IsExtensionPresent(extAttr.Name)
                ? builder.ActivateClass <T1>((paths ?? baseApi.SearchPaths).GetLibraryName())
                : null);
        }
Пример #3
0
 public static TExt Load <TExt>(T baseApi, SearchPathContainer paths)
     where TExt : NativeExtension <T>
 {
     return(LibraryLoader.Load <TExt, T>(baseApi, paths));
 }
Пример #4
0
 public static T Load(SearchPathContainer paths)
 {
     return(LibraryLoader.Load <T>(paths));
 }
Пример #5
0
 public static T Load(SearchPathContainer paths, Ultz.SuperInvoke.Loader.LibraryLoader loader)
 {
     return(LibraryLoader.Load <T>(paths, loader));
 }
Пример #6
0
        public static T1 Load <T1>(SearchPathContainer nameContainer, ISymbolLoader loader) where T1 : NativeAPI
        {
            var builder = new NativeLibraryBuilder(Options).WithSymbolLoader(x => loader ?? x);

            return(builder.ActivateClass <T1>(nameContainer.GetLibraryName()));
        }
Пример #7
0
 public static T1 Load <T1>(SearchPathContainer nameContainer) where T1 : NativeAPI
 {
     CreateBuilder <T1>();
     return(_builders[typeof(T1)].ActivateClass <T1>(nameContainer.GetLibraryName()));
 }
Пример #8
0
 public static T1 Load <T1>
     (SearchPathContainer nameContainer, Ultz.SuperInvoke.Loader.LibraryLoader loader) where T1 : NativeAPI =>
 LibraryActivator.CreateInstance <T1>(nameContainer.GetLibraryName(), loader);
Пример #9
0
 public static T1 Load <T1>
     (SearchPathContainer nameContainer) where T1 : NativeAPI => LibraryActivator.CreateInstance <T1>
     (nameContainer.GetLibraryName());
Пример #10
0
 public static T Load(SearchPathContainer paths, ISymbolLoader loader)
 {
     return(LibraryLoader.Load <T>(paths, loader));
 }