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


C# ITypeDefOrRef类代码示例

本文整理汇总了C#中ITypeDefOrRef的典型用法代码示例。如果您正苦于以下问题:C# ITypeDefOrRef类的具体用法?C# ITypeDefOrRef怎么用?C# ITypeDefOrRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: BaseTypeNodeImpl

		public BaseTypeNodeImpl(ITreeNodeGroup treeNodeGroup, ITypeDefOrRef typeDefOrRef, bool isBaseType) {
			TreeNodeGroup = treeNodeGroup;
			this.isBaseType = isBaseType;
			// Keep weak refs to them so we won't prevent removed modules from being GC'd.
			weakRefTypeDefOrRef = new WeakReference(typeDefOrRef);
			weakRefResolvedTypeDef = new WeakReference(null);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:BaseTypeNodeImpl.cs

示例2: IsGenericParam

		bool IsGenericParam(ITypeDefOrRef tdr) {
			var ts = tdr as TypeSpec;
			if (ts == null)
				return false;
			var sig = ts.TypeSig.RemovePinnedAndModifiers();
			return sig is GenericSig;
		}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:7,代码来源:TypeNames.cs

示例3: TypeDefOrRefSignature

 public TypeDefOrRefSignature(ITypeDefOrRef type, bool isValueType)
 {
     if (type == null)
         throw new ArgumentNullException("type");
     Type = type;
     IsValueType = isValueType;
 }
开发者ID:JerreS,项目名称:AsmResolver,代码行数:7,代码来源:TypeDefOrRefSignature.cs

示例4: Create

		public static EventDefOptions Create(UTF8String name, ITypeDefOrRef eventType) {
			return new EventDefOptions {
				Attributes = 0,
				Name = name,
				EventType = eventType,
			};
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:EventDefOptions.cs

示例5: getTypeInstance

 TypeInstanceResolver getTypeInstance(ITypeDefOrRef typeRef)
 {
     TypeInstanceResolver instance;
     if (!typeRefToInstance.TryGetValue(typeRef, out instance))
         typeRefToInstance[typeRef] = instance = new TypeInstanceResolver(type, typeRef);
     return instance;
 }
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:7,代码来源:TypeResolver.cs

示例6: IsReferencedBy

		static bool IsReferencedBy(TypeDef type, ITypeDefOrRef typeRef, int depth) {
			if (depth >= 30)
				return false;
			// TODO: move it to a better place after adding support for more cases.
			if (type == null)
				return false;
			if (typeRef == null)
				return false;

			if (type == typeRef)
				return true;
			if (type.Name != typeRef.Name)
				return false;
			if (type.Namespace != typeRef.Namespace)
				return false;

			if (type.DeclaringType != null || typeRef.DeclaringType != null) {
				if (type.DeclaringType == null || typeRef.DeclaringType == null)
					return false;
				if (!IsReferencedBy(type.DeclaringType, typeRef.DeclaringType, depth + 1))
					return false;
			}

			return true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:25,代码来源:Helpers.cs

示例7: GenericInstanceTypeSignature

 public GenericInstanceTypeSignature(ITypeDefOrRef genericType)
 {
     if (genericType == null)
         throw new ArgumentNullException("genericType");
     GenericType = genericType;
     GenericArguments = new List<TypeSignature>();
 }
开发者ID:JerreS,项目名称:AsmResolver,代码行数:7,代码来源:GenericInstanceTypeSignature.cs

示例8: AddInitializeArrayCode

		public void AddInitializeArrayCode(Block block, int start, int numToRemove, ITypeDefOrRef elementType, byte[] data) {
			int index = start;
			block.Replace(index++, numToRemove, Instruction.CreateLdcI4(data.Length / elementType.ToTypeSig().ElementType.GetPrimitiveSize()));
			block.Insert(index++, OpCodes.Newarr.ToInstruction(elementType));
			block.Insert(index++, OpCodes.Dup.ToInstruction());
			block.Insert(index++, OpCodes.Ldtoken.ToInstruction((IField)Create(data)));
			block.Insert(index++, OpCodes.Call.ToInstruction((IMethod)InitializeArrayMethod));
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:8,代码来源:InitializedDataCreator.cs

示例9: BaseTypesEntryNode

		public BaseTypesEntryNode(ITypeDefOrRef tr, bool isInterface) {
			if (tr == null)
				throw new ArgumentNullException("tr");
			this.tr = tr;
			this.def = tr.ResolveTypeDef();
			this.isInterface = isInterface;
			this.LazyLoading = true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:8,代码来源:BaseTypesEntryNode.cs

示例10: Create

		public static ITypeDefOrRef Create(ITypeDefOrRef type, IList<TypeSig> genericArgs) {
			if (genericArgs == null || genericArgs.Count == 0)
				return type;
			var ts = type as TypeSpec;
			if (ts == null)
				return type;
			var newSig = Create(ts.TypeSig, genericArgs);
			return newSig == ts.TypeSig ? type : new TypeSpecUser(newSig);
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:9,代码来源:GenericArgsSubstitutor.cs

示例11: GetNonGenericTypeRef

		static ITypeDefOrRef GetNonGenericTypeRef(ITypeDefOrRef typeRef) {
			var ts = typeRef as TypeSpec;
			if (ts == null)
				return typeRef;
			var gis = ts.TryGetGenericInstSig();
			if (gis == null || gis.GenericType == null)
				return typeRef;
			return gis.GenericType.TypeDefOrRef;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:9,代码来源:DeobfuscatorContext.cs

示例12: Create

		public static TypeDefOptions Create(UTF8String ns, UTF8String name, ITypeDefOrRef baseType, bool isNestedType) {
			return new TypeDefOptions {
				Attributes = (isNestedType ? TypeAttributes.NestedPublic : TypeAttributes.Public) | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.AnsiClass,
				Namespace = ns ?? UTF8String.Empty,
				Name = name ?? UTF8String.Empty,
				PackingSize = null,
				ClassSize = null,
				BaseType = baseType,
			};
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:TypeDefOptions.cs

示例13: IsMarkupExtensions

 static bool IsMarkupExtensions(ITypeDefOrRef def)
 {
     while (def != null)
     {
         if (def.Namespace == "OmniXaml" && def.Name.String == "MarkupExtension")
             return true;
         def = def.GetBaseType();
     }
     return false;
 }
开发者ID:kekekeks,项目名称:PerspexVS,代码行数:10,代码来源:MetadataLoader.cs

示例14: resolve

        public Type resolve(ITypeDefOrRef typeRef)
        {
            var resolver = getTypeResolver(typeRef);
            if (resolver != null)
                return resolver.type;

            var ts = typeRef as TypeSpec;
            if (ts != null && ts.TypeSig is GenericSig)
                return typeof(MGenericParameter);

            return null;
        }
开发者ID:n017,项目名称:ConfuserDeobfuscator,代码行数:12,代码来源:AssemblyResolver.cs

示例15: Compare

		static bool Compare(ITypeDefOrRef type, UTF8String expNs, UTF8String expName) {
			if (type == null)
				return false;

			var tr = type as TypeRef;
			if (tr != null)
				return tr.Namespace == expNs && tr.Name == expName;
			var td = type as TypeDef;
			if (td != null)
				return td.Namespace == expNs && td.Name == expName;

			return false;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:13,代码来源:AssemblyInfoTransform.cs


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