本文整理汇总了C#中CustomModifiers类的典型用法代码示例。如果您正苦于以下问题:C# CustomModifiers类的具体用法?C# CustomModifiers怎么用?C# CustomModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CustomModifiers类属于命名空间,在下文中一共展示了CustomModifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LocalVariableInfo
internal LocalVariableInfo(int index, Type type, bool pinned, CustomModifiers customModifiers)
{
this.index = index;
this.type = type;
this.pinned = pinned;
this.customModifiers = customModifiers;
}
示例2: SetSignature
public void SetSignature(Type returnType, CustomModifiers returnTypeCustomModifiers, Type[] parameterTypes, CustomModifiers[] parameterTypeCustomModifiers)
{
method.signature = new MethodSignature(
returnType ?? method.Module.universe.System_Void,
Util.Copy(parameterTypes),
PackedCustomModifiers.CreateFromExternal(returnTypeCustomModifiers, parameterTypeCustomModifiers, parameterTypes.Length),
method.signature.CallingConvention,
method.signature.GenericParameterCount);
}
示例3: FieldBuilder
internal FieldBuilder(TypeBuilder type, string name, Type fieldType, CustomModifiers customModifiers, FieldAttributes attribs)
{
this.typeBuilder = type;
this.name = name;
this.pseudoToken = type.ModuleBuilder.AllocPseudoToken();
this.nameIndex = type.ModuleBuilder.Strings.Add(name);
this.fieldSig = FieldSignature.Create(fieldType, customModifiers);
ByteBuffer sig = new ByteBuffer(5);
fieldSig.WriteSig(this.typeBuilder.ModuleBuilder, sig);
this.signature = this.typeBuilder.ModuleBuilder.Blobs.Add(sig);
this.attribs = attribs;
this.typeBuilder.ModuleBuilder.Field.AddVirtualRecord();
}
示例4: CreateFromExternal
internal static PackedCustomModifiers CreateFromExternal(CustomModifiers returnTypeCustomModifiers, CustomModifiers[] parameterTypeCustomModifiers, int parameterCount)
{
CustomModifiers[] customModifiers = null;
Pack(ref customModifiers, 0, returnTypeCustomModifiers, parameterCount + 1);
if (parameterTypeCustomModifiers != null)
{
for (int i = 0; i < parameterCount; i++)
{
Pack(ref customModifiers, i + 1, parameterTypeCustomModifiers[i], parameterCount + 1);
}
}
return new PackedCustomModifiers(customModifiers);
}
示例5: __AddArgument
public override void __AddArgument(Type argument, bool pinned, CustomModifiers customModifiers)
{
if (pinned)
{
args.Add(MarkerType.Pinned);
}
foreach (CustomModifiers.Entry mod in customModifiers)
{
args.Add(mod.IsRequired ? MarkerType.ModReq : MarkerType.ModOpt);
args.Add(mod.Type);
}
args.Add(argument);
paramCount++;
}
示例6: __ResolveOptionalParameterTypes
public abstract Type[] __ResolveOptionalParameterTypes(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments, out CustomModifiers[] customModifiers);
示例7: ReadCustomModifiers
private static CustomModifiers ReadCustomModifiers(ModuleReader module, ByteReader br, IGenericContext context)
{
CustomModifiers mods = new CustomModifiers();
byte b = br.PeekByte();
if (IsCustomModifier(b))
{
List<Type> required = new List<Type>();
List<Type> optional = new List<Type>();
while (IsCustomModifier(b))
{
bool req = br.ReadByte() == ELEMENT_TYPE_CMOD_REQD;
Type type = ReadTypeDefOrRefEncoded(module, br, context);
(req ? required : optional).Add(type);
b = br.PeekByte();
}
mods.required = required.ToArray();
mods.optional = optional.ToArray();
}
return mods;
}
示例8: __SetSignature
public void __SetSignature(Type returnType, CustomModifiers returnTypeCustomModifiers, Type[] parameterTypes, CustomModifiers[] parameterTypeCustomModifiers)
{
SetSignature(returnType, parameterTypes, PackedCustomModifiers.CreateFromExternal(returnTypeCustomModifiers, parameterTypeCustomModifiers, Util.NullSafeLength(parameterTypes)));
}
示例9: Wrap
protected override Type Wrap(Type type, CustomModifiers mods)
{
return Make(type, mods);
}
示例10: WriteCustomModifiers
protected static void WriteCustomModifiers(ModuleBuilder module, ByteBuffer bb, CustomModifiers modifiers)
{
foreach (CustomModifiers.Entry entry in modifiers)
{
bb.Write(entry.IsRequired ? ELEMENT_TYPE_CMOD_REQD : ELEMENT_TYPE_CMOD_OPT);
bb.WriteTypeDefOrRefEncoded(module.GetTypeTokenForMemberRef(entry.Type));
}
}
示例11: Wrap
internal static PackedCustomModifiers Wrap(CustomModifiers[] modifiers)
{
return new PackedCustomModifiers(modifiers);
}
示例12: PackedCustomModifiers
private PackedCustomModifiers(CustomModifiers[] customModifiers)
{
this.customModifiers = customModifiers;
}
示例13: FieldSignature
private FieldSignature(Type fieldType, CustomModifiers mods)
{
this.fieldType = fieldType;
this.mods = mods;
}
示例14: Create
internal static FieldSignature Create(Type fieldType, CustomModifiers customModifiers)
{
return new FieldSignature(fieldType, customModifiers);
}
示例15: GenericTypeInstance
private GenericTypeInstance(Type type, Type[] args, CustomModifiers[] mods)
{
this.type = type;
this.args = args;
this.mods = mods;
}