// // 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; }
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; Parent.MemberCache.AddMember (this, Get.Spec.Name, Get.Spec); } else { CheckMissingAccessor (kind, parameters, true); } if (Set != null) { spec.Set = Set.Spec; Parent.MemberCache.AddMember (this, Set.Spec.Name, Set.Spec); } else { CheckMissingAccessor (kind, parameters, false); } Parent.MemberCache.AddMember (this, PropertyBuilder.Name, spec); }