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


C# CodeGen.EmitGetHelper方法代码示例

本文整理汇总了C#中CodeGen.EmitGetHelper方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGen.EmitGetHelper方法的具体用法?C# CodeGen.EmitGetHelper怎么用?C# CodeGen.EmitGetHelper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CodeGen的用法示例。


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

示例1: LoadArrayAndIndexes

		void LoadArrayAndIndexes(CodeGen g)
		{
			array.EmitGet(g);

			foreach (Operand op in indexes)
				g.EmitGetHelper(op, Operand.GetType(op) == typeof(int) ? typeof(int) : typeof(long), false);
		}
开发者ID:amithasan,项目名称:Framework-Class-Library-Extension,代码行数:7,代码来源:ArrayAccess.cs

示例2: EmitSet

		protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
		{
		    OperandExtensions.SetLeakedState(this, false);  
			if (!_fi.IsStatic)
				_target.EmitRef(g);

			g.EmitGetHelper(value, GetReturnType(g.TypeMapper), allowExplicitConversion);
			g.IL.Emit(_fi.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, _fi);
		}
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:9,代码来源:Field.cs

示例3: LoadArrayAndIndexes

		void LoadArrayAndIndexes(CodeGen g)
		{
            if (_array.GetReturnType(g.TypeMapper).GetArrayRank() != _indexes.Length)
                throw new ArgumentException(Properties.Messages.ErrIndexCountMismatch);

            _array.EmitGet(g);

			foreach (Operand op in _indexes)
			    g.EmitGetHelper(op, g.TypeMapper.MapType(Helpers.AreTypesEqual(GetType(op, g.TypeMapper), typeof(int), g.TypeMapper) ? typeof(int) : typeof(long)), false);
		}
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:10,代码来源:ArrayAccess.cs

示例4: EmitSet

		internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
		{
			PropertyInfo pi = (PropertyInfo)property.Method.Member;
			MethodInfo mi = pi.GetSetMethod(true);

			if (mi == null)
			{
				base.EmitSet(g, value, allowExplicitConversion);
				return;
			}

			if (!mi.IsStatic)
				target.EmitRef(g);

			property.EmitArgs(g, indexes);
			g.EmitGetHelper(value, Type, allowExplicitConversion);
			g.EmitCallHelper(mi, target);
		}
开发者ID:amithasan,项目名称:Framework-Class-Library-Extension,代码行数:18,代码来源:Property.cs

示例5: EmitGet

        internal override void EmitGet(CodeGen g)
        {
            for (int i = 0; i < indexes.Length; i++)
                g.EmitGetHelper(indexes[i], typeof(int), false);

            if (indexes.Length == 1)
                g.IL.Emit(OpCodes.Newarr, t);
            else
            {
                Type[] argTypes = new Type[indexes.Length];
                for (int i = 0; i < argTypes.Length; i++)
                    argTypes[i] = typeof(int);

                ModuleBuilder mb = t.Module as ModuleBuilder;

                if (mb != null)
                    g.IL.Emit(OpCodes.Newobj, mb.GetArrayMethod(Type, ".ctor", CallingConventions.HasThis, null, argTypes));
                else
                    g.IL.Emit(OpCodes.Newobj, Type.GetConstructor(argTypes));
            }
        }
开发者ID:jimmmeh,项目名称:runsharp,代码行数:21,代码来源:NewArray.cs

示例6: EmitGet

		protected internal override void EmitGet(CodeGen g)  
        {
		    OperandExtensions.SetLeakedState(this, false); 
			for (int i = 0; i < _indexes.Length; i++)
				g.EmitGetHelper(_indexes[i], g.TypeMapper.MapType(typeof(int)), false);

			if (_indexes.Length == 1)
				g.IL.Emit(OpCodes.Newarr, _t);
			else
			{
				Type[] argTypes = new Type[_indexes.Length];
				for (int i = 0; i < argTypes.Length; i++)
					argTypes[i] = g.TypeMapper.MapType(typeof(int));
#if !PHONE8
                ModuleBuilder mb = _t.Module as ModuleBuilder;

				if (mb != null)
					g.IL.Emit(OpCodes.Newobj, mb.GetArrayMethod(GetReturnType(g.TypeMapper), ".ctor", CallingConventions.HasThis, null, argTypes));
				else
#endif
					g.IL.Emit(OpCodes.Newobj, GetReturnType(g.TypeMapper).GetConstructor(argTypes));
			}
		}
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:23,代码来源:NewArray.cs

示例7: EmitGet

		protected internal override void EmitGet(CodeGen g)  
        {
		    OperandExtensions.SetLeakedState(this, false); 
			g.EmitGetHelper(_target, g.TypeMapper.MapType(typeof(object)), false);
			g.IL.Emit(OpCodes.Ldftn, _method);
			g.IL.Emit(OpCodes.Newobj, _delegateConstructor);
		}
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:7,代码来源:NewDelegate.cs

示例8: EmitSet

	    protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
	    {
		    OperandExtensions.SetLeakedState(this, false); 
			LoadArrayAndIndexes(g);

	        if (_indexes.Length == 1)
	        {
	            g.EmitStelemHelper(GetReturnType(g.TypeMapper), value, allowExplicitConversion);
	        }
	        else
	        {
                g.EmitGetHelper(value, GetReturnType(g.TypeMapper), allowExplicitConversion);
	            g.EmitCallHelper(
	                (MethodBase)g.TypeMapper.TypeInfo.FindMethod(
	                    _array.GetReturnType(g.TypeMapper),
	                    "Set",
	                    ArrayUtils.Combine(_indexes, value),
	                    false).Method.Member,
	                _array);
	        }
	    }
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:21,代码来源:ArrayAccess.cs

示例9: EmitSet

		protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
		{
		    OperandExtensions.SetLeakedState(this, false);  
			PropertyInfo pi = (PropertyInfo)_property.Method.Member;
			MethodInfo mi = pi.GetSetMethod(true);

			if (mi == null)
			{
				base.EmitSet(g, value, allowExplicitConversion);
				return;
			}

			if (!mi.IsStatic)
				_target.EmitRef(g);

			_property.EmitArgs(g, _indexes);
			g.EmitGetHelper(value, GetReturnType(g.TypeMapper), allowExplicitConversion);
			g.EmitCallHelper(mi, _target);
		}
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:19,代码来源:Property.cs

示例10: EmitGet

		internal override void EmitGet(CodeGen g)
		{
			g.EmitGetHelper(op, t, true);
		}
开发者ID:amithasan,项目名称:Framework-Class-Library-Extension,代码行数:4,代码来源:Cast.cs

示例11: EmitGet

		protected internal override void EmitGet(CodeGen g)  
        {
		    OperandExtensions.SetLeakedState(this, false); 
			g.EmitGetHelper(_op, _t, true);
		}
开发者ID:AqlaSolutions,项目名称:runsharp,代码行数:5,代码来源:Cast.cs

示例12: EmitSet

        internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
        {
            if (!fi.IsStatic)
                target.EmitRef(g);

            g.EmitGetHelper(value, Type, allowExplicitConversion);
            g.IL.Emit(fi.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, fi);
        }
开发者ID:jimmmeh,项目名称:runsharp,代码行数:8,代码来源:Field.cs

示例13: EmitGet

 internal override void EmitGet(CodeGen g)
 {
     g.EmitGetHelper(target, typeof(object), false);
     g.IL.Emit(OpCodes.Ldftn, method);
     g.IL.Emit(OpCodes.Newobj, delegateConstructor);
 }
开发者ID:jimmmeh,项目名称:runsharp,代码行数:6,代码来源:NewDelegate.cs


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