當前位置: 首頁>>代碼示例>>C#>>正文


C# ModuleDefinition.GetTypeReferences方法代碼示例

本文整理匯總了C#中Mono.Cecil.ModuleDefinition.GetTypeReferences方法的典型用法代碼示例。如果您正苦於以下問題:C# ModuleDefinition.GetTypeReferences方法的具體用法?C# ModuleDefinition.GetTypeReferences怎麽用?C# ModuleDefinition.GetTypeReferences使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.Cecil.ModuleDefinition的用法示例。


在下文中一共展示了ModuleDefinition.GetTypeReferences方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetExpandedTypeDependanceList

		private ICollection<TypeReference> GetExpandedTypeDependanceList(ModuleDefinition module)
		{
			Mono.Collections.Generic.Collection<TypeDefinition> moduleTypes;
			if (!UserDefinedTypes.TryGetValue(module, out moduleTypes))
			{
				throw new Exception("Module types not found.");
			}

			HashSet<TypeReference> firstLevelDependanceTypes = new HashSet<TypeReference>();
			foreach (TypeReference type in moduleTypes)
			{
				if (!firstLevelDependanceTypes.Contains(type))
				{
					firstLevelDependanceTypes.Add(type);
				}
			}

			foreach (TypeReference type in module.GetTypeReferences())
			{
				if (!firstLevelDependanceTypes.Contains(type))
				{
					firstLevelDependanceTypes.Add(type);
				}
			}

			return Telerik.JustDecompiler.Decompiler.Utilities.GetExpandedTypeDependanceList(firstLevelDependanceTypes);
		}
開發者ID:besturn,項目名稱:JustDecompileEngine,代碼行數:27,代碼來源:MSBuildProjectBuilder.cs

示例2: findTypeReference

        public static TypeReference findTypeReference(ModuleDefinition module, string asmSimpleName, string fullName)
        {
            foreach (var type in module.GetTypeReferences()) {
                if (type.FullName != fullName)
                    continue;
                var asmRef = type.Scope as AssemblyNameReference;
                if (asmRef == null || asmRef.Name != asmSimpleName)
                    continue;

                return type;
            }
            return null;
        }
開發者ID:n017,項目名稱:NETDeob,代碼行數:13,代碼來源:DotNetUtils.cs

示例3: GetModuleDependsOnAnalysis

		private ICollection<AssemblyNameReference> GetModuleDependsOnAnalysis(ModuleDefinition module)
		{
			Mono.Collections.Generic.Collection<TypeDefinition> assemblyModuleTypes = module.Types;

			HashSet<TypeReference> firstLevelDependanceTypes = new HashSet<TypeReference>();
			foreach (TypeReference type in assemblyModuleTypes)
			{
				if (!firstLevelDependanceTypes.Contains(type))
				{
					firstLevelDependanceTypes.Add(type);
				}
			}

			foreach (TypeReference type in module.GetTypeReferences())
			{
				if (!firstLevelDependanceTypes.Contains(type))
				{
					firstLevelDependanceTypes.Add(type);
				}
			}

			ICollection<TypeReference> expadendTypeDependanceList = Utilities.GetExpandedTypeDependanceList(firstLevelDependanceTypes);
			ICollection<AssemblyNameReference> dependingOnAssemblies = Utilities.GetAssembliesDependingOn(module, expadendTypeDependanceList);

			foreach (AssemblyNameReference assemblyReference in module.AssemblyReferences)
			{
				if (!dependingOnAssemblies.Contains(assemblyReference))
				{
					dependingOnAssemblies.Add(assemblyReference);
				}
			}

			return dependingOnAssemblies;
		}
開發者ID:GiGatR00n,項目名稱:JustDecompileEngine,代碼行數:34,代碼來源:TypeCollisionWriterContextService.cs


注:本文中的Mono.Cecil.ModuleDefinition.GetTypeReferences方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。