当前位置: 首页>>代码示例>>C#>>正文


C# EmitContext类代码示例

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


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

示例1: EmitPopIfNeeded

 private void EmitPopIfNeeded(EmitContext emitContext)
 {
     if (GetReturnType() == typeof(void) && body.Type != typeof(void))
     {
         emitContext.ig.Emit(OpCodes.Pop);
     }
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:7,代码来源:LambdaExpression.net30.cs

示例2: EmitPopIfNeeded

		void EmitPopIfNeeded (EmitContext ec)
		{
			if (add_method.ReturnType == typeof (void))
				return;

			ec.ig.Emit (OpCodes.Pop);
		}
开发者ID:rabink,项目名称:mono,代码行数:7,代码来源:ElementInit.cs

示例3: Emit

		internal override void Emit (EmitContext ec)
		{
			ec.EmitIsInst (expression, type_operand);

			ec.ig.Emit (OpCodes.Ldnull);
			ec.ig.Emit (OpCodes.Cgt_Un);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:TypeBinaryExpression.cs

示例4: EmitLoadField

		LocalBuilder EmitLoadField (EmitContext ec, FieldInfo field)
		{
			var store = ec.ig.DeclareLocal (field.FieldType);
			ec.ig.Emit (OpCodes.Ldfld, field);
			ec.ig.Emit (OpCodes.Stloc, store);
			return store;
		}
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:7,代码来源:MemberBinding.cs

示例5: Emit

		internal override void Emit (EmitContext ec)
		{
			var ig = ec.ig;
			var type = this.Type;

			LocalBuilder local = null;
			if (type.IsValueType) {
				local = ig.DeclareLocal (type);
				ig.Emit (OpCodes.Ldloca, local);

				if (constructor == null) {
					ig.Emit (OpCodes.Initobj, type);
					ig.Emit (OpCodes.Ldloc, local);
					return;
				}
			}

			ec.EmitCollection (arguments);

			if (type.IsValueType) {
				ig.Emit (OpCodes.Call, constructor);
				ig.Emit (OpCodes.Ldloc, local);
			} else
				ig.Emit (OpCodes.Newobj, constructor ?? GetDefaultConstructor (type));
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:25,代码来源:NewExpression.cs

示例6: Emit

		internal override void Emit (EmitContext ec, LocalBuilder local)
		{
			var member = EmitLoadMember (ec, local);

			foreach (var initializer in initializers)
				initializer.Emit (ec, member);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:7,代码来源:MemberListBinding.cs

示例7: Emit

		internal override void Emit (EmitContext ec, LocalBuilder local)
		{
			var member = EmitLoadMember (ec, local);

			foreach (var binding in bindings)
				binding.Emit (ec, member);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:MemberMemberBinding.cs

示例8: EmitPropertyAccess

		void EmitPropertyAccess (EmitContext ec, PropertyInfo property)
		{
			var getter = property.GetGetMethod (true);
			if (!getter.IsStatic)
				ec.EmitLoadSubject (expression);

			ec.EmitCall (getter);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:MemberExpression.cs

示例9: EmitFieldAccess

		void EmitFieldAccess (EmitContext ec, FieldInfo field)
		{
			if (!field.IsStatic) {
				ec.EmitLoadSubject (expression);
				ec.ig.Emit (OpCodes.Ldfld, field);
			} else
				ec.ig.Emit (OpCodes.Ldsfld, field);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:MemberExpression.cs

示例10: EmitLoadMember

		internal LocalBuilder EmitLoadMember (EmitContext ec, LocalBuilder local)
		{
			ec.EmitLoadSubject (local);

			return member.OnFieldOrProperty<LocalBuilder> (
				field => EmitLoadField (ec, field),
				prop => EmitLoadProperty (ec, prop));
		}
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:8,代码来源:MemberBinding.cs

示例11: Emit

 internal override void Emit(EmitContext emitContext)
 {
     _member.OnFieldOrProperty
     (
         field => EmitFieldAccess(emitContext, field),
         prop => EmitPropertyAccess(emitContext, prop)
     );
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:8,代码来源:MemberExpression.net30.cs

示例12: EmitPopIfNeeded

 private void EmitPopIfNeeded(EmitContext emitContext)
 {
     if (_addMethod.ReturnType == typeof(void))
     {
         return;
     }
     emitContext.ig.Emit(OpCodes.Pop);
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:8,代码来源:ElementInit.net30.cs

示例13: EmitLoadMember

 internal LocalBuilder EmitLoadMember(EmitContext emitContext, LocalBuilder local)
 {
     emitContext.EmitLoadSubject(local);
     return _member.OnFieldOrProperty
     (
         field => EmitLoadField(emitContext, field),
         prop => EmitLoadProperty(emitContext, prop)
     );
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:9,代码来源:MemberBinding.net30.cs

示例14: EmitPropertyAccess

 private void EmitPropertyAccess(EmitContext emitContext, PropertyInfo property)
 {
     var getter = property.GetGetMethod(true);
     if (!getter.IsStatic)
     {
         emitContext.EmitLoadSubject(_expression);
     }
     emitContext.EmitCall(getter);
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:9,代码来源:MemberExpression.net30.cs

示例15: EmitTypeAs

		void EmitTypeAs (EmitContext ec)
		{
			var type = this.Type;

			ec.EmitIsInst (operand, type);

			if (type.IsNullable ())
				ec.ig.Emit (OpCodes.Unbox_Any, type);
		}
开发者ID:qwertie,项目名称:Theraot,代码行数:9,代码来源:UnaryExpression.net30.cs


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