private Assembly HandlerImpl(object sender, ResolveEventArgs args) {
if (_ignore) return null;
var id = new AssemblyName(args.Name).Name;
Assembly result;
if (_cached.TryGetValue(id, out result)) return result;
if (string.Equals(id, "System.Web", StringComparison.OrdinalIgnoreCase)) {
if (MessageBox.Show("Looks like you don’t have .NET 4.5.2 installed. Would you like to install it?", "Error",
MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes) {
Process.Start("http://www.microsoft.com/en-us/download/details.aspx?id=42642");
}
Environment.Exit(10);
}
#if LOCALIZABLE
if (name == "Content Manager.resources" && _first) {
Log(">> Content Manager.resources <<");
return null;
}
if (name.EndsWith(".resources")) {
var culture = splitted.ElementAtOrDefault(2)?.Split(new[] { "Culture=" }, StringSplitOptions.None).ElementAtOrDefault(1);
Log("culture: " + culture);
if (culture == "neutral") return null;
var resourceId = CultureInfo.CurrentUICulture.IetfLanguageTag;
if (!string.Equals(resourceId, "en-US", StringComparison.OrdinalIgnoreCase)) {
name = name.Replace(".resources", "." + resourceId);
Log("localized: " + name);
} else {
Log("skip: " + args.Name);
return null;
}
}
#else
if (id.StartsWith("PresentationFramework") || id.EndsWith(".resources")) return null;
#endif
if (id == "Magick.NET-x86") return null;
if (_logFilename != null) {
Log("Resolve: " + args.Name + " as " + id);
}
try {
_ignore = true;
result = Extract(id);
if (OptionCache) {
_cached[id] = result;
}
return result;
} finally {
_ignore = false;
}
}