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


C# TypeDef.ToTypeSig方法代码示例

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


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

示例1: ResolveGenericArgument

 private static VTable ResolveGenericArgument(TypeDef openType, GenericInstSig genInst, VTable vTable)
 {
     Debug.Assert(openType == vTable.Type);
     var ret = new VTable(openType);
     ret.GenericArguments = genInst.GenericArguments;
     foreach (VTableSlot slot in vTable.Slots) {
         MethodSig newSig = GenericArgumentResolver.Resolve(slot.Signature.MethodSig, genInst.GenericArguments);
         TypeSig newDecl = slot.DeclaringType;
         if (new SigComparer().Equals(newDecl, openType))
             newDecl = new GenericInstSig((ClassOrValueTypeSig)openType.ToTypeSig(), genInst.GenericArguments.ToArray());
         else
             newDecl = GenericArgumentResolver.Resolve(newDecl, genInst.GenericArguments);
         ret.Slots.Add(new VTableSlot(ret, slot.MethodDef, newDecl, new VTableSignature(genInst, newSig, slot.Signature.Name)).Override(slot));
     }
     return ret;
 }
开发者ID:2sic4you,项目名称:ConfuserEx,代码行数:16,代码来源:VTable.cs

示例2: CreateField

        private FieldDef CreateField(RPContext ctx, TypeDef delegateType)
        {
            // Details will be filled in during metadata writing
            TypeDef randomType;
            do {
                randomType = ctx.Module.Types[ctx.Random.NextInt32(ctx.Module.Types.Count)];
            } while (randomType.HasGenericParameters || randomType.IsGlobalModuleType || randomType.IsDelegate());

            TypeSig fieldType = new CModOptSig(randomType, delegateType.ToTypeSig());

            var field = new FieldDefUser("", new FieldSig(fieldType), FieldAttributes.Static | FieldAttributes.Assembly);
            field.CustomAttributes.Add(new CustomAttribute(GetKeyAttr(ctx).FindInstanceConstructors().First()));
            delegateType.Fields.Add(field);

            ctx.Marker.Mark(field);
            ctx.Name.SetCanRename(field, false);

            return field;
        }
开发者ID:Jamie-Lewis,项目名称:ConfuserEx,代码行数:19,代码来源:StrongMode.cs

示例3: BaseTypes

        private static IEnumerable<TypeSig> BaseTypes(TypeDef typeDef)
        {
            if (typeDef == null)
                yield break;
            if (typeDef.BaseType == null)
                yield break;

            TypeSig baseType = typeDef.ToTypeSig();
            do {
                var genericArgs = baseType is GenericInstSig ? ((GenericInstSig)baseType).GenericArguments : null;
                baseType = GenericArgumentResolver.Resolve(typeDef.BaseType.ToTypeSig(), genericArgs, null);
                yield return baseType;

                typeDef = typeDef.BaseType.ResolveTypeDef();
                if (typeDef == null)
                    break;
            } while (typeDef.BaseType != null);
        }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:18,代码来源:TypesHierarchyHelpers.cs

示例4: BaseTypes

		private static IEnumerable<TypeSig> BaseTypes(TypeDef type)
		{
			return BaseTypes(type.ToTypeSig());
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:TypesHierarchyHelpers.cs


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