本文整理汇总了C#中dnlib.DotNet.GenericParamContext类的典型用法代码示例。如果您正苦于以下问题:C# GenericParamContext类的具体用法?C# GenericParamContext怎么用?C# GenericParamContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericParamContext类属于dnlib.DotNet命名空间,在下文中一共展示了GenericParamContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CorMethodSpec
public CorMethodSpec(CorModuleDef readerModule, uint rid, GenericParamContext gpContext) {
this.readerModule = readerModule;
this.rid = rid;
origRid = rid;
this.gpContext = gpContext;
Initialize_NoLock();
}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:CorMethodSpec.cs
示例2: CorStandAloneSig
public CorStandAloneSig(CorModuleDef readerModule, uint rid, GenericParamContext gpContext) {
this.readerModule = readerModule;
this.rid = rid;
this.origRid = rid;
this.gpContext = gpContext;
Initialize_NoLock();
}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:CorStandAloneSig.cs
示例3: CorTypeSpec
public CorTypeSpec(CorModuleDef readerModule, uint rid, GenericParamContext gpContext)
{
this.readerModule = readerModule;
this.rid = rid;
this.origRid = rid;
this.gpContext = gpContext;
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:7,代码来源:CorTypeSpec.cs
示例4: CorInterfaceImpl
public CorInterfaceImpl(CorModuleDef readerModule, uint rid, GenericParamContext gpContext) {
this.readerModule = readerModule;
this.rid = rid;
this.origRid = rid;
this.gpContext = gpContext;
Initialize_NoLock();
}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:CorInterfaceImpl.cs
示例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);
}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:8,代码来源:CorDeclSecurity.cs
示例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();
}
开发者ID:GodLesZ,项目名称:de4dot,代码行数:9,代码来源:MethodBodyReader.cs
示例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;
}
开发者ID:NSentinel,项目名称:dnlib,代码行数:10,代码来源:CustomAttributeReader.cs
示例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;
}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:DndbgSignatureReader.cs
示例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");
}
}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:18,代码来源:OpCodeHandler.cs
示例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];
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:10,代码来源:ModuleDefMD.cs
示例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];
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:10,代码来源:ModuleDefMD.cs
示例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;
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:18,代码来源:ModuleDefMD.cs
示例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);
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:11,代码来源:ModuleDefMD.cs
示例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);
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:14,代码来源:ModuleDefMD.cs
示例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;
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:28,代码来源:ModuleDefMD.cs
示例16: ReadGenericParamConstraint
/// <summary>
/// Reads a new <see cref="GenericParamConstraintMD"/> instance. This one is not cached.
/// </summary>
/// <param name="rid">Row ID</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A new <see cref="GenericParamConstraintMD"/> instance</returns>
internal GenericParamConstraintMD ReadGenericParamConstraint(uint rid, GenericParamContext gpContext)
{
return new GenericParamConstraintMD(this, rid, gpContext);
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:10,代码来源:ModuleDefMD.cs
示例17: ResolveToken
/// <summary>
/// Resolves a token
/// </summary>
/// <param name="token">The metadata token</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A <see cref="IMDTokenProvider"/> or <c>null</c> if <paramref name="token"/> is invalid</returns>
public override IMDTokenProvider ResolveToken(uint token, GenericParamContext gpContext)
{
uint rid = MDToken.ToRID(token);
switch (MDToken.ToTable(token)) {
case Table.Module: return ResolveModule(rid);
case Table.TypeRef: return ResolveTypeRef(rid);
case Table.TypeDef: return ResolveTypeDef(rid);
case Table.Field: return ResolveField(rid);
case Table.Method: return ResolveMethod(rid);
case Table.Param: return ResolveParam(rid);
case Table.InterfaceImpl: return ResolveInterfaceImpl(rid, gpContext);
case Table.MemberRef: return ResolveMemberRef(rid, gpContext);
case Table.Constant: return ResolveConstant(rid);
case Table.DeclSecurity: return ResolveDeclSecurity(rid);
case Table.ClassLayout: return ResolveClassLayout(rid);
case Table.StandAloneSig: return ResolveStandAloneSig(rid, gpContext);
case Table.Event: return ResolveEvent(rid);
case Table.Property: return ResolveProperty(rid);
case Table.ModuleRef: return ResolveModuleRef(rid);
case Table.TypeSpec: return ResolveTypeSpec(rid, gpContext);
case Table.ImplMap: return ResolveImplMap(rid);
case Table.Assembly: return ResolveAssembly(rid);
case Table.AssemblyRef: return ResolveAssemblyRef(rid);
case Table.File: return ResolveFile(rid);
case Table.ExportedType: return ResolveExportedType(rid);
case Table.ManifestResource:return ResolveManifestResource(rid);
case Table.GenericParam: return ResolveGenericParam(rid);
case Table.MethodSpec: return ResolveMethodSpec(rid, gpContext);
case Table.GenericParamConstraint: return ResolveGenericParamConstraint(rid, gpContext);
}
return null;
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:38,代码来源:ModuleDefMD.cs
示例18: ResolveTypeSpec
/// <summary>
/// Resolves a <see cref="TypeSpec"/>
/// </summary>
/// <param name="rid">The row ID</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A <see cref="TypeSpec"/> instance or <c>null</c> if <paramref name="rid"/> is invalid</returns>
public TypeSpec ResolveTypeSpec(uint rid, GenericParamContext gpContext)
{
return listTypeSpecMD[rid - 1, gpContext];
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:10,代码来源:ModuleDefMD.cs
示例19: MemberRefMD
/// <summary>
/// Constructor
/// </summary>
/// <param name="readerModule">The module which contains this <c>MemberRef</c> row</param>
/// <param name="rid">Row ID</param>
/// <param name="gpContext">Generic parameter context</param>
/// <exception cref="ArgumentNullException">If <paramref name="readerModule"/> is <c>null</c></exception>
/// <exception cref="ArgumentException">If <paramref name="rid"/> is invalid</exception>
public MemberRefMD(ModuleDefMD readerModule, uint rid, GenericParamContext gpContext) {
#if DEBUG
if (readerModule == null)
throw new ArgumentNullException("readerModule");
if (readerModule.TablesStream.MemberRefTable.IsInvalidRID(rid))
throw new BadImageFormatException(string.Format("MemberRef rid {0} does not exist", rid));
#endif
this.origRid = rid;
this.rid = rid;
this.readerModule = readerModule;
this.module = readerModule;
uint @class, name;
uint signature = readerModule.TablesStream.ReadMemberRefRow(origRid, out @class, out name);
this.name = readerModule.StringsStream.ReadNoNull(name);
[email protected] = readerModule.ResolveMemberRefParent(@class, gpContext);
this.signature = readerModule.ReadSignature(signature, gpContext);
}
开发者ID:xingkongtianyu,项目名称:Protect.NET,代码行数:25,代码来源:MemberRef.cs
示例20: ReadMarshalType
/// <summary>
/// Reads a <see cref="MarshalType"/> from the blob
/// </summary>
/// <param name="table">Table of owner</param>
/// <param name="rid">Row ID of owner</param>
/// <param name="gpContext">Generic parameter context</param>
/// <returns>A new <see cref="MarshalType"/> instance or <c>null</c> if there's no field
/// marshal for this owner.</returns>
internal MarshalType ReadMarshalType(Table table, uint rid, GenericParamContext gpContext)
{
var row = TablesStream.ReadFieldMarshalRow(MetaData.GetFieldMarshalRid(table, rid));
if (row == null)
return null;
return MarshalBlobReader.Read(this, row.NativeType, gpContext);
}
开发者ID:dmirmilshteyn,项目名称:dnlib,代码行数:15,代码来源:ModuleDefMD.cs
注:本文中的dnlib.DotNet.GenericParamContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论