コード例 #1
0
 public void IsMatchingNativeLibraryPositiveMatches(string os, string requestedFileName, string actualFileName)
 {
     Assert.True(NativeLibPathUtils.IsMatchingNativeLibrary(
                     new FakeRuntimeEnvironment {
         OperatingSystem = os
     }, requestedFileName, actualFileName));
 }
コード例 #2
0
 public void IsMatchingNativeLibraryNegativeMatches(string os, Platform platform, string requestedFileName, string actualFileName)
 {
     Assert.False(NativeLibPathUtils.IsMatchingNativeLibrary(
                      new FakeRuntimeEnvironment {
         OperatingSystem = os, OperatingSystemPlatform = platform
     }, requestedFileName, actualFileName));
 }
コード例 #3
0
ファイル: ProjectAssemblyLoader.cs プロジェクト: yossidev/dnx
        private IntPtr LoadUnamangedLibrary(string path, string name)
        {
            foreach (var nativeLibFullPath in Directory.EnumerateFiles(path))
            {
                if (NativeLibPathUtils.IsMatchingNativeLibrary(RuntimeEnvironmentHelper.RuntimeEnvironment, name, Path.GetFileName(nativeLibFullPath)))
                {
                    return(_loadContextAccessor.Default.LoadUnmanagedLibraryFromPath(nativeLibFullPath));
                }
            }

            return(IntPtr.Zero);
        }