本文整理汇总了C#中IKVM.Reflection.Emit.MethodBuilder类的典型用法代码示例。如果您正苦于以下问题:C# MethodBuilder类的具体用法?C# MethodBuilder怎么用?C# MethodBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MethodBuilder类属于IKVM.Reflection.Emit命名空间,在下文中一共展示了MethodBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PatchCallingConvention
private void PatchCallingConvention(MethodBuilder mdBuilder)
{
if (patchCallingConvention && !mdBuilder.IsStatic)
{
sig.HasThis = true;
}
}
示例2: AddOtherMethod
public void AddOtherMethod(MethodBuilder mdBuilder)
{
Accessor acc;
acc.Semantics = MethodSemanticsTable.Other;
acc.Method = mdBuilder;
accessors.Add(acc);
}
示例3: SetSetMethod
public void SetSetMethod(MethodBuilder mdBuilder)
{
setter = mdBuilder;
Accessor acc;
acc.Semantics = MethodSemanticsTable.Setter;
acc.Method = mdBuilder;
accessors.Add(acc);
}
示例4: SetRemoveOnMethod
public void SetRemoveOnMethod(MethodBuilder mdBuilder)
{
removeOnMethod = mdBuilder;
Accessor acc;
acc.Semantics = MethodSemanticsTable.RemoveOn;
acc.Method = mdBuilder;
accessors.Add(acc);
}
示例5: SetRaiseMethod
public void SetRaiseMethod(MethodBuilder mdBuilder)
{
fireMethod = mdBuilder;
Accessor acc;
acc.Semantics = MethodSemanticsTable.Fire;
acc.Method = mdBuilder;
accessors.Add(acc);
}
示例6: AddOtherMethod
public void AddOtherMethod(MethodBuilder mdBuilder)
{
if (otherMethods == null)
{
otherMethods = new List<MethodBuilder>();
}
otherMethods.Add(mdBuilder);
}
示例7: AddOtherMethod
public void AddOtherMethod(MethodBuilder mdBuilder)
{
PatchCallingConvention(mdBuilder);
if (otherMethods == null)
{
otherMethods = new List<MethodBuilder>();
}
otherMethods.Add(mdBuilder);
}
示例8: SetParameters
private static void SetParameters(ClassLoaderWrapper loader, MethodBuilder mb, IKVM.Internal.MapXml.Param[] parameters)
{
if(parameters != null)
{
for(int i = 0; i < parameters.Length; i++)
{
ParameterBuilder pb = mb.DefineParameter(i + 1, ParameterAttributes.None, parameters[i].Name);
if(parameters[i].Attributes != null)
{
for(int j = 0; j < parameters[i].Attributes.Length; j++)
{
AttributeHelper.SetCustomAttribute(loader, pb, parameters[i].Attributes[j]);
}
}
}
}
}
示例9: CopyLinkDemands
private static void CopyLinkDemands(MethodBuilder mb, MethodInfo mi)
{
foreach (CustomAttributeData cad in CustomAttributeData.__GetDeclarativeSecurity(mi))
{
if (cad.ConstructorArguments.Count == 0 || (int)cad.ConstructorArguments[0].Value == (int)SecurityAction.LinkDemand)
{
mb.__AddDeclarativeSecurity(cad.__ToBuilder());
}
}
}
示例10: GetSerializationConstructor
internal MethodBuilder GetSerializationConstructor()
{
if (baseSerializationCtor == null)
{
baseSerializationCtor = Serialization.AddAutomagicSerializationToWorkaroundBaseClass(typeBuilder, wrapper.BaseTypeWrapper.GetSerializationConstructor());
}
return baseSerializationCtor;
}
示例11: SetRemoveOnMethod
public void SetRemoveOnMethod(MethodBuilder mdBuilder)
{
removeOnMethod = mdBuilder;
}
示例12: IlProcessor
public IlProcessor(MethodBuilder builder)
{
this.builder = builder;
this.instructions = new Collection<Instruction>();
}
示例13: AddParameterMetadata
private void AddParameterMetadata(MethodBuilder method, MethodWrapper mw)
{
ParameterBuilder[] pbs;
if((mw.DeclaringType.IsPublic && (mw.IsPublic || mw.IsProtected)) || classLoader.EmitDebugInfo)
{
string[] parameterNames = new string[mw.GetParameters().Length];
GetParameterNamesFromXml(mw.Name, mw.Signature, parameterNames);
GetParameterNamesFromSig(mw.Signature, parameterNames);
pbs = GetParameterBuilders(method, parameterNames.Length, parameterNames);
}
else
{
pbs = GetParameterBuilders(method, mw.GetParameters().Length, null);
}
if((mw.Modifiers & Modifiers.VarArgs) != 0 && pbs.Length > 0)
{
AttributeHelper.SetParamArrayAttribute(pbs[pbs.Length - 1]);
}
AddXmlMapParameterAttributes(method, Name, mw.Name, mw.Signature, ref pbs);
}
示例14: SetSetMethod
public void SetSetMethod(MethodBuilder mdBuilder)
{
PatchCallingConvention(mdBuilder);
setter = mdBuilder;
}
示例15: SetAddOnMethod
public void SetAddOnMethod(MethodBuilder mdBuilder)
{
addOnMethod = mdBuilder;
}