public virtual IAssembly LoadAssembly(AssemblyIdentity assemblyIdentity) {
IUnit/*?*/ unit;
lock (GlobalLock.LockingObject) {
this.unitCache.TryGetValue(assemblyIdentity, out unit);
}
IAssembly/*?*/ result;
if (unit != null)
result = unit as IAssembly;
else {
if (string.IsNullOrEmpty(assemblyIdentity.Location) || string.Equals(assemblyIdentity.Location, "unknown://location", StringComparison.OrdinalIgnoreCase)) {
result = Dummy.Assembly;
lock (GlobalLock.LockingObject) {
this.unitCache.Add(assemblyIdentity, result);
}
} else {
unit = this.LoadUnitFrom(assemblyIdentity.Location);
result = unit as IAssembly;
if (result != null && this.UnifyAssembly(result).Equals(assemblyIdentity))
lock (GlobalLock.LockingObject) {
this.unitCache[assemblyIdentity] = result;
this.coreIdentities.Add(result.CoreAssemblySymbolicIdentity);
}
}
}
if (result == null) result = Dummy.Assembly;
return result;
}