本文整理汇总了C#中Mono.CSharp.ParametersCompiled.GetMetaInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ParametersCompiled.GetMetaInfo方法的具体用法?C# ParametersCompiled.GetMetaInfo怎么用?C# ParametersCompiled.GetMetaInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.ParametersCompiled
的用法示例。
在下文中一共展示了ParametersCompiled.GetMetaInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DefineMethodBuilder
//
// Creates full MethodBuilder for the method
//
public MethodBuilder DefineMethodBuilder (TypeDefinition container, ParametersCompiled param)
{
DefineMethodBuilder (container);
builder.SetReturnType (method.ReturnType.GetMetaInfo ());
builder.SetParameters (param.GetMetaInfo ());
return builder;
}
示例2: DefineMethodBuilder
/// <summary>
/// Create the MethodBuilder for the method
/// </summary>
void DefineMethodBuilder (TypeDefinition container, string method_name, ParametersCompiled param)
{
var return_type = method.ReturnType.GetMetaInfo ();
var p_types = param.GetMetaInfo ();
if (builder == null) {
builder = container.TypeBuilder.DefineMethod (
method_name, flags, method.CallingConventions,
return_type, p_types);
return;
}
//
// Generic method has been already defined to resolve method parameters
// correctly when they use type parameters
//
builder.SetParameters (p_types);
builder.SetReturnType (return_type);
if (builder.Attributes != flags) {
#if STATIC
builder.__SetAttributes (flags);
#else
try {
if (methodbuilder_attrs_field == null)
methodbuilder_attrs_field = typeof (MethodBuilder).GetField ("attrs", BindingFlags.NonPublic | BindingFlags.Instance);
methodbuilder_attrs_field.SetValue (builder, flags);
} catch {
container.Compiler.Report.RuntimeMissingSupport (method.Location, "Generic method MethodAttributes");
}
#endif
}
}
示例3: DefineBuilders
protected void DefineBuilders (MemberKind kind, ParametersCompiled parameters)
{
PropertyBuilder = Parent.TypeBuilder.DefineProperty (
GetFullName (MemberName), PropertyAttributes.None,
#if !BOOTSTRAP_BASIC // Requires trunk version mscorlib
IsStatic ? 0 : CallingConventions.HasThis,
#endif
MemberType.GetMetaInfo (), null, null,
parameters.GetMetaInfo (), null, null);
PropertySpec spec;
if (kind == MemberKind.Indexer)
spec = new IndexerSpec (Parent.Definition, this, MemberType, parameters, PropertyBuilder, ModFlags);
else
spec = new PropertySpec (kind, Parent.Definition, this, MemberType, PropertyBuilder, ModFlags);
if (Get != null) {
spec.Get = Get.Spec;
var method = Get.Spec.GetMetaInfo () as MethodBuilder;
if (method != null) {
PropertyBuilder.SetGetMethod (method);
Parent.MemberCache.AddMember (this, method.Name, Get.Spec);
}
} else {
CheckMissingAccessor (kind, parameters, true);
}
if (Set != null) {
spec.Set = Set.Spec;
var method = Set.Spec.GetMetaInfo () as MethodBuilder;
if (method != null) {
PropertyBuilder.SetSetMethod (method);
Parent.MemberCache.AddMember (this, method.Name, Set.Spec);
}
} else {
CheckMissingAccessor (kind, parameters, false);
}
Parent.MemberCache.AddMember (this, PropertyBuilder.Name, spec);
}
示例4: DefineBuilders
protected void DefineBuilders(MemberKind kind, ParametersCompiled parameters)
{
// FIXME - PropertyAttributes.HasDefault ?
PropertyBuilder = Parent.TypeBuilder.DefineProperty (
GetFullName (MemberName), PropertyAttributes.None, MemberType.GetMetaInfo (), parameters.GetMetaInfo ());
PropertySpec spec;
if (kind == MemberKind.Indexer)
spec = new IndexerSpec (Parent.Definition, this, MemberType, parameters, PropertyBuilder, ModFlags);
else
spec = new PropertySpec (kind, Parent.Definition, this, MemberType, PropertyBuilder, ModFlags);
spec.Get = Get.Spec;
spec.Set = Set.Spec;
if (!Get.IsDummy) {
PropertyBuilder.SetGetMethod (GetBuilder);
}
if (!Set.IsDummy) {
PropertyBuilder.SetSetMethod (SetBuilder);
}
Parent.MemberCache.AddMember (this, Get.IsDummy ? Get.Name : GetBuilder.Name, Get.Spec);
Parent.MemberCache.AddMember (this, Set.IsDummy ? Set.Name : SetBuilder.Name, Set.Spec);
Parent.MemberCache.AddMember (this, PropertyBuilder.Name, spec);
}