예제 #1
0
        internal static IntPtr LoadLibrary(string dllLoc, OsType type, out ILibraryLoader loader)
        {
            switch (type)
            {
            case OsType.Windows32:
            case OsType.Windows64:
                loader = new WindowsLibraryLoader();
                return(loader.LoadLibrary(dllLoc));

            case OsType.Linux32:
            case OsType.Linux64:
            case OsType.Armv6HardFloat:
            case OsType.Armv7HardFloat:
                loader = new LinuxLibraryLoader();
                return(loader.LoadLibrary(dllLoc));

            case OsType.MacOs32:
            case OsType.MacOs64:
                loader = new MacOsLibraryLoader();
                return(loader.LoadLibrary(dllLoc));

            case OsType.RoboRio:
                loader = new RoboRioLibraryLoader();
                return(loader.LoadLibrary(dllLoc));

            case OsType.Android:
                loader = new AndroidLibraryLoader();
                return(loader.LoadLibrary(dllLoc));

            default:
                loader = null;
                return(IntPtr.Zero);
            }
        }
 internal static IntPtr LoadLibrary(string dllLoc, OsType type, out ILibraryLoader loader)
 {
     switch (type)
     {
         case OsType.Windows32:
         case OsType.Windows64:
             loader = new WindowsLibraryLoader();
             return loader.LoadLibrary(dllLoc);
         case OsType.Linux32:
         case OsType.Linux64:
         case OsType.Armv6HardFloat:
         case OsType.Armv7HardFloat:
             loader = new LinuxLibraryLoader();
             return loader.LoadLibrary(dllLoc);
         case OsType.MacOs32:
         case OsType.MacOs64:
             loader = new MacOsLibraryLoader();
             return loader.LoadLibrary(dllLoc);
         case OsType.RoboRio:
             loader = new RoboRioLibraryLoader();
             return loader.LoadLibrary(dllLoc);
         case OsType.Android:
             loader = new AndroidLibraryLoader();
             return loader.LoadLibrary(dllLoc);
         default:
             loader = null;
             return IntPtr.Zero;
     }
 }