本文整理汇总了C#中System.Reflection.Emit.SignatureHelper.AddArgument方法的典型用法代码示例。如果您正苦于以下问题:C# SignatureHelper.AddArgument方法的具体用法?C# SignatureHelper.AddArgument怎么用?C# SignatureHelper.AddArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.SignatureHelper
的用法示例。
在下文中一共展示了SignatureHelper.AddArgument方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMethodSpecSigHelper
internal static SignatureHelper GetMethodSpecSigHelper(Module scope, Type[] inst)
{
SignatureHelper sigHelp = new SignatureHelper(scope, MdSigCallingConvention.GenericInst);
sigHelp.AddData(inst.Length);
foreach(Type t in inst)
sigHelp.AddArgument(t);
return sigHelp;
}
示例2: GetPropertySigHelper
/// <include file='doc\SignatureHelper.uex' path='docs/doc[@for="SignatureHelper.GetPropertySigHelper"]/*' />
public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes)
{
SignatureHelper sigHelp;
if (returnType == null)
{
returnType = typeof(void);
}
sigHelp = new SignatureHelper(mod, IMAGE_CEE_CS_CALLCONV_PROPERTY, (Type)returnType);
if (parameterTypes != null)
{
for (int i=0; i<parameterTypes.Length; i++)
{
sigHelp.AddArgument(parameterTypes[i]);
}
}
return sigHelp;
}
示例3: GetMethodSigHelper
internal static SignatureHelper GetMethodSigHelper(
Module mod,
CallingConventions callingConvention,
Type returnType,
Type[] parameterTypes)
{
SignatureHelper sigHelp;
int intCall;
if (returnType == null)
{
returnType = typeof(void);
}
intCall = IMAGE_CEE_CS_CALLCONV_DEFAULT;
if ((callingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs)
{
intCall = IMAGE_CEE_CS_CALLCONV_VARARG;
}
if ((callingConvention & CallingConventions.HasThis) == CallingConventions.HasThis)
{
intCall |= IMAGE_CEE_CS_CALLCONV_HASTHIS;
}
sigHelp = new SignatureHelper(mod, intCall, (Type)returnType);
if (parameterTypes != null)
{
for (int i=0; i<parameterTypes.Length; i++)
{
sigHelp.AddArgument(parameterTypes[i]);
}
}
return sigHelp;
}
示例4: GetMethodSpecSigHelper
internal static SignatureHelper GetMethodSpecSigHelper(Module scope, Type[] inst)
{
SignatureHelper helper = new SignatureHelper(scope, System.Reflection.MdSigCallingConvention.Default | System.Reflection.MdSigCallingConvention.GenericInst);
helper.AddData(inst.Length);
foreach (Type type in inst)
{
helper.AddArgument(type);
}
return helper;
}
示例5: lock
// Create a signature helper for a property signature.
public static SignatureHelper GetPropertySigHelper
(Module mod, Type returnType, Type[] parameterTypes)
{
lock(typeof(AssemblyBuilder))
{
// Convert the module into a signature create context.
IntPtr context = ModuleToContext(mod);
// Create the basic signature helper.
IntPtr sig = ClrSigCreateProperty
(context, CSToILType(mod, context, returnType));
SignatureHelper helper = new SignatureHelper
(mod, context, sig);
// Add the parameters to the helper.
if(parameterTypes != null)
{
foreach(Type type in parameterTypes)
{
helper.AddArgument(type);
}
}
return helper;
}
}
示例6: GetMethodSpecSigHelper
internal static SignatureHelper GetMethodSpecSigHelper(Module scope, Type[] inst)
{
SignatureHelper sigHelp = new SignatureHelper(scope, IMAGE_CEE_CS_CALLCONV_GENERICINST);
sigHelp.AddData(inst.Length);
foreach(Type t in inst)
sigHelp.AddArgument(t);
return sigHelp;
}