本文整理汇总了C#中dnlib.DotNet.GenericParamContext类的典型用法代码示例。如果您正苦于以下问题:C# GenericParamContext类的具体用法?C# GenericParamContext怎么用?C# GenericParamContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericParamContext类属于dnlib.DotNet命名空间,在下文中一共展示了GenericParamContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CorMethodSpec
public CorMethodSpec(CorModuleDef readerModule, uint rid, GenericParamContext gpContext) {
this.readerModule = readerModule;
this.rid = rid;
origRid = rid;
this.gpContext = gpContext;
Initialize_NoLock();
}
示例2: CorStandAloneSig
public CorStandAloneSig(CorModuleDef readerModule, uint rid, GenericParamContext gpContext) {
this.readerModule = readerModule;
this.rid = rid;
this.origRid = rid;
this.gpContext = gpContext;
Initialize_NoLock();
}
示例3: CorTypeSpec
public CorTypeSpec(CorModuleDef readerModule, uint rid, GenericParamContext gpContext)
{
this.readerModule = readerModule;
this.rid = rid;
this.origRid = rid;
this.gpContext = gpContext;
}
示例4: CorInterfaceImpl
public CorInterfaceImpl(CorModuleDef readerModule, uint rid, GenericParamContext gpContext) {
this.readerModule = readerModule;
this.rid = rid;
this.origRid = rid;
this.gpContext = gpContext;
Initialize_NoLock();
}
示例5: InitializeSecurityAttributes
protected override void InitializeSecurityAttributes() {
var mdi = readerModule.MetaDataImport;
uint token = OriginalToken.Raw;
var data = MDAPI.GetPermissionSetBlob(mdi, token) ?? new byte[0];
var gpContext = new GenericParamContext();
var tmp = DeclSecurityReader.Read(readerModule, data, gpContext);
Interlocked.CompareExchange(ref securityAttributes, tmp, null);
}
示例6: Read
public void Read(MethodDef method) {
this.gpContext = GenericParamContext.Create(method);
this.parameters = method.Parameters;
SetLocals(GetLocals(method));
maxStackSize = (ushort)reader.ReadInt32();
ReadInstructionsNumBytes(reader.ReadUInt32());
ReadExceptionHandlers();
}
示例7: CustomAttributeReader
CustomAttributeReader(ModuleDefMD readerModule, uint offset, GenericParamContext gpContext)
{
this.module = readerModule;
this.reader = readerModule.BlobStream.CreateStream(offset);
this.ownReader = true;
this.genericArguments = null;
this.recursionCounter = new RecursionCounter();
this.verifyReadAllBytes = false;
this.gpContext = gpContext;
}
示例8: ResolveTypeDefOrRef
public ITypeDefOrRef ResolveTypeDefOrRef(uint codedToken, GenericParamContext gpContext) {
uint token;
if (!CodedToken.TypeDefOrRef.Decode(codedToken, out token))
return null;
uint rid = MDToken.ToRID(token);
switch (MDToken.ToTable(token)) {
case Table.TypeDef: return new TypeDefDndbg(mdi, rid);
case Table.TypeRef: return new TypeRefDndbg(mdi, rid);
case Table.TypeSpec: return new TypeSpecDndbg(mdi, rid, this);
}
return null;
}
示例9: arithmetic_read
static Instruction arithmetic_read(BinaryReader reader, IInstructionOperandResolver resolver, GenericParamContext gpContext) {
switch (reader.ReadByte()) {
case 0: return OpCodes.Add.ToInstruction();
case 1: return OpCodes.Add_Ovf.ToInstruction();
case 2: return OpCodes.Add_Ovf_Un.ToInstruction();
case 3: return OpCodes.Sub.ToInstruction();
case 4: return OpCodes.Sub_Ovf.ToInstruction();
case 5: return OpCodes.Sub_Ovf_Un.ToInstruction();
case 6: return OpCodes.Mul.ToInstruction();
case 7: return OpCodes.Mul_Ovf.ToInstruction();
case 8: return OpCodes.Mul_Ovf_Un.ToInstruction();
case 9: return OpCodes.Div.ToInstruction();
case 10: return OpCodes.Div_Un.ToInstruction();
case 11: return OpCodes.Rem.ToInstruction();
case 12: return OpCodes.Rem_Un.ToInstruction();
default: throw new ApplicationException("Invalid opcode");
}
}
示例10: ResolveStandAloneSig
/// <summary>
/// Resolves a <see cref="StandAloneSig"/>
/// </summary>
/// <param name="rid">The row ID</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A <see cref="StandAloneSig"/> instance or <c>null</c> if <paramref name="rid"/> is invalid</returns>
public StandAloneSig ResolveStandAloneSig(uint rid, GenericParamContext gpContext)
{
return listStandAloneSigMD[rid - 1, gpContext];
}
示例11: ResolveMethodSpec
/// <summary>
/// Resolves a <see cref="MethodSpec"/>
/// </summary>
/// <param name="rid">The row ID</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A <see cref="MethodSpec"/> instance or <c>null</c> if <paramref name="rid"/> is invalid</returns>
public MethodSpec ResolveMethodSpec(uint rid, GenericParamContext gpContext)
{
return listMethodSpecMD[rid - 1, gpContext];
}
示例12: ResolveCustomAttributeType
/// <summary>
/// Resolves a <see cref="ICustomAttributeType"/>
/// </summary>
/// <param name="codedToken">A <c>CustomAttributeType</c> coded token</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A <see cref="ICustomAttributeType"/> or <c>null</c> if <paramref name="codedToken"/> is invalid</returns>
public ICustomAttributeType ResolveCustomAttributeType(uint codedToken, GenericParamContext gpContext)
{
uint token;
if (!CodedToken.CustomAttributeType.Decode(codedToken, out token))
return null;
uint rid = MDToken.ToRID(token);
switch (MDToken.ToTable(token)) {
case Table.Method: return ResolveMethod(rid);
case Table.MemberRef: return ResolveMemberRef(rid, gpContext);
}
return null;
}
示例13: ReadTypeSignature
/// <summary>
/// Reads a type signature from the #Blob stream
/// </summary>
/// <param name="sig">#Blob stream offset of signature</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A new <see cref="TypeSig"/> instance or <c>null</c> if
/// <paramref name="sig"/> is invalid.</returns>
public TypeSig ReadTypeSignature(uint sig, GenericParamContext gpContext)
{
return SignatureReader.ReadTypeSig(this, sig, gpContext);
}
示例14: ReadCustomAttribute
/// <summary>
/// Reads a <see cref="CustomAttribute"/>
/// </summary>
/// <param name="caRid">Custom attribute rid</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A new <see cref="CustomAttribute"/> instance or <c>null</c> if
/// <paramref name="caRid"/> is invalid</returns>
public CustomAttribute ReadCustomAttribute(uint caRid, GenericParamContext gpContext)
{
var caRow = TablesStream.ReadCustomAttributeRow(caRid);
if (caRow == null)
return null;
return CustomAttributeReader.Read(this, ResolveCustomAttributeType(caRow.Type, gpContext), caRow.Value, gpContext);
}
示例15: ReadMethodBody
/// <summary>
/// Reads a method body
/// </summary>
/// <param name="method">Method</param>
/// <param name="rva">Method RVA</param>
/// <param name="implAttrs">Method impl attrs</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A <see cref="MethodBody"/> or <c>null</c> if none</returns>
internal MethodBody ReadMethodBody(MethodDefMD method, RVA rva, MethodImplAttributes implAttrs, GenericParamContext gpContext)
{
MethodBody mb;
var mDec = methodDecrypter;
if (mDec != null && mDec.GetMethodBody(method.OrigRid, rva, method.Parameters, gpContext, out mb)) {
var cilBody = mb as CilBody;
if (cilBody != null)
return InitializeBodyFromPdb(cilBody, method.OrigRid);
return mb;
}
if (rva == 0)
return null;
var codeType = implAttrs & MethodImplAttributes.CodeTypeMask;
if (codeType == MethodImplAttributes.IL)
return InitializeBodyFromPdb(ReadCilBody(method.Parameters, rva, gpContext), method.OrigRid);
if (codeType == MethodImplAttributes.Native)
return new NativeMethodBody(rva);
return null;
}