/// <summary> /// Gets project reference from candidates. /// </summary> /// <param name="scope">Scope.</param> /// <returns>Project reference.</returns> private ProjectReference GetFromCandidates(IMetadataScope scope) { string publicKeyToken = scope.GetScopePublicKeyToken(); string assemblyName = scope.GetAssemblyName(); return(CandidateReferences.FirstOrDefault( item => string.Compare(item.Name, assemblyName, StringComparison.OrdinalIgnoreCase) == 0 && string.Compare(item.PublicKeyToken, publicKeyToken, StringComparison.OrdinalIgnoreCase) == 0)); }
public AssemblyWrapper GetAssembly(IMetadataScope scope) { AssemblyWrapper wrapper; string assemblyName = scope.GetAssemblyName(); string key = assemblyName + ".dll"; if (!this.assemblies.TryGetValue(key, out wrapper)) { bool system = this.OperationContext.IsSystemAssembly(assemblyName); wrapper = new AssemblyWrapper(this, key, system); this.assemblies.Add(wrapper.Name, wrapper); } return(wrapper); }
public static bool SameScope(IMetadataScope left, IMetadataScope right) { return(left.GetAssemblyName() == right.GetAssemblyName()); }