コード例 #1
0
        private AssemblyNameInfo[] InjectMsTestIntoReferencedAssemblyNames(IMetadataAssembly assembly)
        {
            var referencedAssemblyNames = assembly.ReferencedAssembliesNames;
            var updatedReferencedAssemblyNames = new AssemblyNameInfo[referencedAssemblyNames.Length + 1];

            Array.Copy(referencedAssemblyNames, updatedReferencedAssemblyNames, referencedAssemblyNames.Length);
            updatedReferencedAssemblyNames[referencedAssemblyNames.Length] = new AssemblyNameInfo(DotNetMsTestAssemblyName);

            SetReferencedAssemblyNames(assembly, updatedReferencedAssemblyNames);

            return referencedAssemblyNames;
        }
コード例 #2
0
 public IMetadataAccess ResolveAssembly(AssemblyNameInfo name, out FileSystemPath assemblyLocation)
 {
     try
     {
         Assembly assembly = Assembly.Load(name.FullName);
         assemblyLocation = new FileSystemPath((AssemblyUtils.GetAssemblyLocalPath(assembly)));
         return MetadataProviderFactory.DefaultProvider.GetFromFile(assemblyLocation);
     }
     catch
     {
         assemblyLocation = null;
         return null;
     }
 }
コード例 #3
0
 private void SetReferencedAssemblyNames(IMetadataAssembly assembly, AssemblyNameInfo[] referencedAssemblyNames)
 {
     assembly.SetField("myReferencedAssembliesNames", referencedAssemblyNames);
 }
コード例 #4
0
 public IEnumerable<FileSystemPath> GetAnnotationsFiles(AssemblyNameInfo assemblyName,
     FileSystemPath assemblyLocation)
 {
     return extensionManager.IsInstalled() ? EmptyList<FileSystemPath>.InstanceList : myAnnotations[assemblyName.Name];
 }
コード例 #5
0
 public IEnumerable<FileSystemPath> GetAnnotationsFiles(AssemblyNameInfo assemblyName = null, FileSystemPath assemblyLocation = null)
 {
     if (assemblyName == null)
         return annotations.Values;
     return annotations[assemblyName.Name];
 }
コード例 #6
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="asmName">Assembly name info</param>
		/// <exception cref="ArgumentNullException">If <paramref name="asmName"/> is <c>null</c></exception>
		public AssemblyRefUser(AssemblyNameInfo asmName) {
			if (asmName == null)
				throw new ArgumentNullException("asmName");

			this.version = asmName.Version ?? new Version(0, 0, 0, 0);
			this.publicKeyOrToken = asmName.PublicKeyOrToken;
			this.name = UTF8String.IsNullOrEmpty(asmName.Name) ? UTF8String.Empty : asmName.Name;
			this.locale = asmName.Locale;
			this.flags = publicKeyOrToken is PublicKey ? AssemblyAttributes.PublicKey : AssemblyAttributes.None;
		}
コード例 #7
0
		/// <inheritdoc/>
		public AssemblyDef Resolve(AssemblyNameInfo assembly, ModuleDef sourceModule) {
			return null;
		}
コード例 #8
0
 private static bool ReferencesAssembly(IProject project, AssemblyNameInfo name)
 {
     AssemblyNameInfo info;
     return ReferencedAssembliesService.IsProjectReferencingAssemblyByName(project,
         project.GetCurrentTargetFrameworkId(), name, out info);
 }
コード例 #9
0
 public IMetadataTypeInfo GetTypeInfoFromQualifiedName(string name, AssemblyNameInfo assemblyName, bool searchReferencedAssemblies)
 {
     return _metadataAssembly.GetTypeInfoFromQualifiedName(name, assemblyName, searchReferencedAssemblies);
 }
コード例 #10
0
 public static bool IsProjectReferencingAssembly([CanBeNull] this IProjectElement projectElement, AssemblyNameInfo assemblyNameInfo)
 {
     AssemblyNameInfo referencedAssembly;
     return ReferencedAssembliesService.IsProjectReferencingAssemblyByName(projectElement, assemblyNameInfo, out referencedAssembly);
 }