当前位置: 首页>>代码示例>>C#>>正文


C# ModuleDef.GetAssemblyRefs方法代码示例

本文整理汇总了C#中ModuleDef.GetAssemblyRefs方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleDef.GetAssemblyRefs方法的具体用法?C# ModuleDef.GetAssemblyRefs怎么用?C# ModuleDef.GetAssemblyRefs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModuleDef的用法示例。


在下文中一共展示了ModuleDef.GetAssemblyRefs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResXProjectFile

		public ResXProjectFile(ModuleDef module, string filename, string typeFullName, EmbeddedResource er) {
			this.filename = filename;
			TypeFullName = typeFullName;
			embeddedResource = er;

			newToOldAsm = new Dictionary<IAssembly, IAssembly>(new AssemblyNameComparer(AssemblyNameComparerFlags.All & ~AssemblyNameComparerFlags.Version));
			foreach (var asmRef in module.GetAssemblyRefs())
				newToOldAsm[asmRef] = asmRef;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:ResXProjectFile.cs

示例2: GetAssemblyRefs

		IEnumerable<IAssembly> GetAssemblyRefs(ModuleDef module, IEnumerable<string> extraAssemblyReferences) {
			foreach (var a in module.GetAssemblyRefs())
				yield return a;
			foreach (var s in extraAssemblyReferences) {
				var info = new AssemblyNameInfo(s);
				if (info.Version != null)
					yield return info;
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:MetadataReferenceFinder.cs

示例3: GetDotNetVersion2035Internal

		static Dnr2035Version GetDotNetVersion2035Internal(ModuleDef module) {
			var ver = Dnr2035Version.V20;
			foreach (var r in module.GetAssemblyRefs()) {
				if (dotNet35Asms.Contains(r.FullName))
					return Dnr2035Version.V35;
				if (dotNet30Asms.Contains(r.FullName))
					ver = Dnr2035Version.V30;
			}
			var asm = module.Assembly;
			if (asm != null && module.IsManifestModule) {
				if (dotNet35Asms.Contains(asm.FullName))
					return Dnr2035Version.V35;
				if (dotNet30Asms.Contains(asm.FullName))
					ver = Dnr2035Version.V30;
			}
			return ver;
		}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:17,代码来源:DotNetUtils.cs

示例4: GetModules

		static IEnumerable<ModuleDef> GetModules(ModuleDef module) {
			yield return module;
			foreach (var asmRef in module.GetAssemblyRefs()) {
				var asm = module.Context.AssemblyResolver.Resolve(asmRef, module);
				if (asm != null)
					yield return asm.ManifestModule;
			}
		}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:8,代码来源:DotNetUtils.cs

示例5: GetResolvedContractAssemblies

		IEnumerable<AssemblyDef> GetResolvedContractAssemblies(ModuleDef module) {
			var nonContractAsms = new HashSet<IAssembly>(AssemblyNameComparer.CompareAll);
			var stack = new Stack<AssemblyRef>(module.GetAssemblyRefs());
			while (stack.Count > 0) {
				cancellationToken.ThrowIfCancellationRequested();
				var asmRef = stack.Pop();
				if (!contractsPublicKeyToken.Equals(asmRef.PublicKeyOrToken?.Token))
					continue;
				if (checkedContractsAssemblies.Contains(asmRef))
					continue;
				checkedContractsAssemblies.Add(asmRef);

				var contractsAsm = module.Context.AssemblyResolver.Resolve(asmRef, module);
				if (contractsAsm != null) {
					yield return contractsAsm;
					foreach (var m in contractsAsm.Modules) {
						foreach (var ar in m.GetAssemblyRefs()) {
							cancellationToken.ThrowIfCancellationRequested();
							if (contractsPublicKeyToken.Equals(ar.PublicKeyOrToken))
								stack.Push(ar);
							else
								nonContractAsms.Add(ar);
						}
					}
				}
			}
			foreach (var asmRef in nonContractAsms) {
				cancellationToken.ThrowIfCancellationRequested();
				var asm = module.Context.AssemblyResolver.Resolve(asmRef, module);
				if (asm != null)
					yield return asm;
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:33,代码来源:MetadataReferenceFinder.cs

示例6: IsNonSupportedAssembly

		static bool IsNonSupportedAssembly(ModuleDef module, AssemblyDef asm, IAssembly assembly) {
			if (AssemblyNameComparer.NameAndPublicKeyTokenOnly.Equals(asm, assembly))
				return true;
			foreach (var asmRef in module.GetAssemblyRefs()) {
				if (AssemblyNameComparer.NameAndPublicKeyTokenOnly.Equals(asmRef, assembly))
					return true;
			}
			return false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:MergeWithAssemblyCommand.cs


注:本文中的ModuleDef.GetAssemblyRefs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。