public string MapLibraryName([NotNull] DllConfiguration configuration, [NotNull] string libraryName) { var mapEntry = configuration.GetRelevantMaps().FirstOrDefault(m => m.SourceLibrary == libraryName); if (mapEntry is null) { return(libraryName); } return(mapEntry.TargetLibrary ?? throw new InvalidOperationException ( "The given library had a mapping, but the mapping lacked a target library." )); }
public DllConfiguration GetDllMap([NotNull] Assembly assembly) { return(DllConfiguration.Parse(File.ReadAllText(GetDllMapPath(assembly)))); }
public bool HasDllMapFile([NotNull] Assembly assembly) { var mapPath = GetDllMapPath(assembly); return(File.Exists(mapPath) && DllConfiguration.TryParse(File.ReadAllText(mapPath), out _)); }