本文整理匯總了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);
}