本文整理汇总了C#中System.Reflection.Emit.SignatureHelper.GetSignature方法的典型用法代码示例。如果您正苦于以下问题:C# SignatureHelper.GetSignature方法的具体用法?C# SignatureHelper.GetSignature怎么用?C# SignatureHelper.GetSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.SignatureHelper
的用法示例。
在下文中一共展示了SignatureHelper.GetSignature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Emit
public override void Emit(OpCode opcode, SignatureHelper signature)
{
if (signature == null)
throw new ArgumentNullException(nameof(signature));
Contract.EndContractBlock();
int stackchange = 0;
EnsureCapacity(7);
InternalEmit(opcode);
// The only IL instruction that has VarPop behaviour, that takes a
// Signature token as a parameter is calli. Pop the parameters and
// the native function pointer. To be conservative, do not pop the
// this pointer since this information is not easily derived from
// SignatureHelper.
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
{
Contract.Assert(opcode.Equals(OpCodes.Calli),
"Unexpected opcode encountered for StackBehaviour VarPop.");
// Pop the arguments..
stackchange -= signature.ArgumentCount;
// Pop native function pointer off the stack.
stackchange--;
UpdateStackSize(opcode, stackchange);
}
int token = GetTokenForSig(signature.GetSignature(true)); ;
PutInteger4(token);
}
示例2: Emit
public override void Emit(OpCode opcode, SignatureHelper signature)
{
if (signature == null)
{
throw new ArgumentNullException("signature");
}
int stackchange = 0;
base.EnsureCapacity(7);
base.InternalEmit(opcode);
if (opcode.m_pop == StackBehaviour.Varpop)
{
stackchange -= signature.ArgumentCount;
stackchange--;
base.UpdateStackSize(opcode, stackchange);
}
int num2 = this.AddSignature(signature.GetSignature(true));
base.PutInteger4(num2);
}