• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Emit.MethodBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IKVM.Reflection.Emit.MethodBuilder的典型用法代码示例。如果您正苦于以下问题:C# MethodBuilder类的具体用法?C# MethodBuilder怎么用?C# MethodBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MethodBuilder类属于IKVM.Reflection.Emit命名空间,在下文中一共展示了MethodBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PatchCallingConvention

		private void PatchCallingConvention(MethodBuilder mdBuilder)
		{
			if (patchCallingConvention && !mdBuilder.IsStatic)
			{
				sig.HasThis = true;
			}
		}
开发者ID:koush,项目名称:mono,代码行数:7,代码来源:PropertyBuilder.cs


示例2: AddOtherMethod

		public void AddOtherMethod(MethodBuilder mdBuilder)
		{
			Accessor acc;
			acc.Semantics = MethodSemanticsTable.Other;
			acc.Method = mdBuilder;
			accessors.Add(acc);
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:7,代码来源:EventBuilder.cs


示例3: SetSetMethod

		public void SetSetMethod(MethodBuilder mdBuilder)
		{
			setter = mdBuilder;
			Accessor acc;
			acc.Semantics = MethodSemanticsTable.Setter;
			acc.Method = mdBuilder;
			accessors.Add(acc);
		}
开发者ID:ngraziano,项目名称:mono,代码行数:8,代码来源:PropertyBuilder.cs


示例4: SetRemoveOnMethod

		public void SetRemoveOnMethod(MethodBuilder mdBuilder)
		{
			removeOnMethod = mdBuilder;
			Accessor acc;
			acc.Semantics = MethodSemanticsTable.RemoveOn;
			acc.Method = mdBuilder;
			accessors.Add(acc);
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:8,代码来源:EventBuilder.cs


示例5: SetRaiseMethod

		public void SetRaiseMethod(MethodBuilder mdBuilder)
		{
			fireMethod = mdBuilder;
			Accessor acc;
			acc.Semantics = MethodSemanticsTable.Fire;
			acc.Method = mdBuilder;
			accessors.Add(acc);
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:8,代码来源:EventBuilder.cs


示例6: AddOtherMethod

		public void AddOtherMethod(MethodBuilder mdBuilder)
		{
			if (otherMethods == null)
			{
				otherMethods = new List<MethodBuilder>();
			}
			otherMethods.Add(mdBuilder);
		}
开发者ID:koush,项目名称:mono,代码行数:8,代码来源:EventBuilder.cs


示例7: AddOtherMethod

		public void AddOtherMethod(MethodBuilder mdBuilder)
		{
			PatchCallingConvention(mdBuilder);
			if (otherMethods == null)
			{
				otherMethods = new List<MethodBuilder>();
			}
			otherMethods.Add(mdBuilder);
		}
开发者ID:koush,项目名称:mono,代码行数:9,代码来源:PropertyBuilder.cs


示例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]);
							}
						}
					}
				}
			}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:17,代码来源:CompilerClassLoader.cs


示例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());
					}
				}
			}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:10,代码来源:CompilerClassLoader.cs


示例10: GetSerializationConstructor

 internal MethodBuilder GetSerializationConstructor()
 {
     if (baseSerializationCtor == null)
     {
         baseSerializationCtor = Serialization.AddAutomagicSerializationToWorkaroundBaseClass(typeBuilder, wrapper.BaseTypeWrapper.GetSerializationConstructor());
     }
     return baseSerializationCtor;
 }
开发者ID:T0pp3r,项目名称:ikvm-fork,代码行数:8,代码来源:AotTypeWrapper.cs


示例11: SetRemoveOnMethod

		public void SetRemoveOnMethod(MethodBuilder mdBuilder)
		{
			removeOnMethod = mdBuilder;
		}
开发者ID:koush,项目名称:mono,代码行数:4,代码来源:EventBuilder.cs


示例12: IlProcessor

 public IlProcessor(MethodBuilder builder)
 {
     this.builder = builder;
     this.instructions = new Collection<Instruction>();
 }
开发者ID:Karapuska,项目名称:Totem,代码行数:5,代码来源:ILProcessor.cs


示例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);
 }
开发者ID:T0pp3r,项目名称:ikvm-fork,代码行数:20,代码来源:AotTypeWrapper.cs


示例14: SetSetMethod

		public void SetSetMethod(MethodBuilder mdBuilder)
		{
			PatchCallingConvention(mdBuilder);
			setter = mdBuilder;
		}
开发者ID:koush,项目名称:mono,代码行数:5,代码来源:PropertyBuilder.cs


示例15: SetAddOnMethod

		public void SetAddOnMethod(MethodBuilder mdBuilder)
		{
			addOnMethod = mdBuilder;
		}
开发者ID:koush,项目名称:mono,代码行数:4,代码来源:EventBuilder.cs


示例16: AddXmlMapParameterAttributes

 internal void AddXmlMapParameterAttributes(MethodBuilder method, string className, string methodName, string methodSig, ref ParameterBuilder[] pbs)
 {
     IKVM.Internal.MapXml.Param[] parameters = classLoader.GetXmlMapParameters(className, methodName, methodSig);
     if(parameters != null)
     {
         if(pbs == null)
         {
             // let's hope that the parameters array is the right length
             pbs = GetParameterBuilders(method, parameters.Length, null);
         }
         for(int i = 0; i < pbs.Length; i++)
         {
             if(parameters[i].Attributes != null)
             {
                 foreach(IKVM.Internal.MapXml.Attribute attr in parameters[i].Attributes)
                 {
                     AttributeHelper.SetCustomAttribute(classLoader, pbs[i], attr);
                 }
             }
         }
     }
 }
开发者ID:T0pp3r,项目名称:ikvm-fork,代码行数:22,代码来源:AotTypeWrapper.cs


示例17: SetRaiseMethod

		public void SetRaiseMethod(MethodBuilder mdBuilder)
		{
			fireMethod = mdBuilder;
		}
开发者ID:koush,项目名称:mono,代码行数:4,代码来源:EventBuilder.cs


示例18: AddDeclaredExceptions

		internal static void AddDeclaredExceptions(MethodBuilder mb, IKVM.Internal.MapXml.Throws[] throws)
		{
			if (throws != null)
			{
				string[] exceptions = new string[throws.Length];
				for (int i = 0; i < exceptions.Length; i++)
				{
					exceptions[i] = throws[i].Class;
				}
				AttributeHelper.SetThrowsAttribute(mb, exceptions);
			}
		}
开发者ID:Semogj,项目名称:ikvm-fork,代码行数:12,代码来源:CompilerClassLoader.cs


示例19: GenericTypeParameterBuilder

		internal GenericTypeParameterBuilder(string name, MethodBuilder method, int position)
			: this(name, null, method, position, Signature.ELEMENT_TYPE_MVAR)
		{
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:4,代码来源:TypeBuilder.cs


示例20: DoLink

				internal override MethodBase DoLink()
				{
					MethodAttributes attr = MapMethodAccessModifiers(m.Modifiers);
					RemapperTypeWrapper typeWrapper = (RemapperTypeWrapper)DeclaringType;
					Type[] paramTypes = typeWrapper.GetClassLoader().ArgTypeListFromSig(m.Sig);

					ConstructorBuilder cbCore = null;

					if(typeWrapper.shadowType.IsSealed)
					{
						mbHelper = typeWrapper.typeBuilder.DefineMethod("newhelper", attr | MethodAttributes.Static, CallingConventions.Standard, typeWrapper.shadowType, paramTypes);
						if(m.Attributes != null)
						{
							foreach(IKVM.Internal.MapXml.Attribute custattr in m.Attributes)
							{
								AttributeHelper.SetCustomAttribute(DeclaringType.GetClassLoader(), mbHelper, custattr);
							}
						}
						SetParameters(DeclaringType.GetClassLoader(), mbHelper, m.Params);
						AttributeHelper.SetModifiers(mbHelper, (Modifiers)m.Modifiers, false);
						AttributeHelper.SetNameSig(mbHelper, "<init>", m.Sig);
						AddDeclaredExceptions(mbHelper, m.throws);
					}
					else
					{
						cbCore = typeWrapper.typeBuilder.DefineConstructor(attr, CallingConventions.Standard, paramTypes);
						if(m.Attributes != null)
						{
							foreach(IKVM.Internal.MapXml.Attribute custattr in m.Attributes)
							{
								AttributeHelper.SetCustomAttribute(DeclaringType.GetClassLoader(), cbCore, custattr);
							}
						}
						SetParameters(DeclaringType.GetClassLoader(), cbCore, m.Params);
						AddDeclaredExceptions(cbCore, m.throws);
					}
					return cbCore;
				}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:38,代码来源:CompilerClassLoader.cs



注:本文中的IKVM.Reflection.Emit.MethodBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Emit.TypeBuilder类代码示例发布时间:2022-05-26
下一篇:
C# Reflection.Type类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap