()
| 35 | { |
| 36 | static string BaseWindMDDir = null; |
| 37 | static Reflector() |
| 38 | { |
| 39 | AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += (sender, eventArgs) => Assembly.ReflectionOnlyLoad(eventArgs.Name); |
| 40 | WindowsRuntimeMetadata.ReflectionOnlyNamespaceResolve += (sender, eventArgs) => |
| 41 | { |
| 42 | |
| 43 | string path = |
| 44 | WindowsRuntimeMetadata.ResolveNamespace(eventArgs.NamespaceName, Enumerable.Empty<string>()) |
| 45 | .FirstOrDefault(); |
| 46 | |
| 47 | if (path == null) return; |
| 48 | |
| 49 | if (!String.IsNullOrEmpty(BaseWindMDDir)) |
| 50 | { |
| 51 | var newPath = Path.Combine(BaseWindMDDir, System.IO.Path.GetFileName(path)); |
| 52 | eventArgs.ResolvedAssemblies.Add(Assembly.ReflectionOnlyLoadFrom(newPath)); |
| 53 | } |
| 54 | else |
| 55 | { |
| 56 | eventArgs.ResolvedAssemblies.Add(Assembly.ReflectionOnlyLoadFrom(path)); |
| 57 | } |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | public static IEnumerable<string> GetNamespaces(string winmdFile, string baseWinMDDir) |
| 62 | { |
nothing calls this directly
no outgoing calls
no test coverage detected