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


C# ILGenerator.Call方法代码示例

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


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

示例1: AppendMessageHeaderCore

		protected override void AppendMessageHeaderCore(
			ILGenerator generator, ForEachLoop loop, MessageField field)
		{
			LocalBuilder length = generator.DeclareLocal(typeof(int));
			loop.Create(body => {
				body.Emit(OpCodes.Ldarg_1);
				loop.LoadCurrentAs(FieldType);
				field.AppendFieldLength(generator);
				body.Emit(OpCodes.Ldloc, length.LocalIndex);
				body.Emit(OpCodes.Add);
				body.Emit(OpCodes.Stloc, length.LocalIndex);
			});

			generator.Emit(OpCodes.Ldloc, length.LocalIndex);
			Label done = generator.DefineLabel();
			generator.Emit(OpCodes.Brfalse, done);

			generator.Emit(OpCodes.Ldarg_1);
			generator.Emit(OpCodes.Ldc_I4, MessageTag.AsInt(field.Number, WireType.String));
			generator.Call<MessageWriter>("WriteVarint", typeof(uint));
			generator.Emit(OpCodes.Ldloc, length.LocalIndex);
			generator.Call<MessageWriter>("WriteVarint", typeof(uint)).Pop();
			generator.MarkLabel(done);
		}
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:24,代码来源:PackedFieldIO.cs

示例2: AppendWriteField

 public override void AppendWriteField(ILGenerator il)
 {
     il.Call<MessageWriter>("WriteBytes", typeof(byte[]));
 }
开发者ID:drunkcod,项目名称:ProtoSharp,代码行数:4,代码来源:MessageFieldBytes.cs

示例3: AppendWriteField

 public override void AppendWriteField(ILGenerator il)
 {
     il.Call<MessageWriter>("WriteZigZag", FieldType);
 }
开发者ID:drunkcod,项目名称:ProtoSharp,代码行数:4,代码来源:MessageFieldZigZagInt32.cs

示例4: AppendWriteField

		public override void AppendWriteField(ILGenerator generator)
		{
			generator.Call<MessageWriter>("WriteZigZag", typeof(int));
		}
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:4,代码来源:MessageFieldZigZagInt32.cs

示例5: AppendReadField

		public override void AppendReadField(ILGenerator generator)
		{
			generator.Call<MessageReader>("ReadZigZag32");
		}
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:4,代码来源:MessageFieldZigZagInt32.cs

示例6: AppendWriteField

 public override void AppendWriteField(ILGenerator il)
 {
     il.Emit(OpCodes.Conv_I4);
     il.Call<MessageWriter>("WriteZigZag", typeof(int));
 }
开发者ID:drunkcod,项目名称:ProtoSharp,代码行数:5,代码来源:MessageFieldZigZagInt16.cs

示例7: AppendWriteField

 public override void AppendWriteField(ILGenerator il)
 {
     il.Call<MessageWriter>("WriteVarint", typeof(int));
 }
开发者ID:drunkcod,项目名称:ProtoSharp,代码行数:4,代码来源:MessageFieldEnum.cs

示例8: AppendWriteField

		public override void AppendWriteField(ILGenerator generator)
		{
			generator.Call<MessageWriter>("WriteFixed", FieldType);
		}
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:4,代码来源:MessageFieldFixed.cs

示例9: AppendReadField

		public override void AppendReadField(ILGenerator generator)
		{
			generator.Call<MessageReader>("ReadFixed" + FieldType.Name);
		}
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:4,代码来源:MessageFieldFixed.cs

示例10: SaveFromWillLoad

 public void SaveFromWillLoad(ILGenerator ilGenerator, Action<ILGenerator> pushWriter, Action<ILGenerator> pushValue)
 {
     pushWriter(ilGenerator);
     pushValue(ilGenerator);
     ilGenerator.Call(_saver);
 }
开发者ID:quyenbc,项目名称:BTDB,代码行数:6,代码来源:SimpleFieldHandlerBase.cs

示例11: SkipLoad

 public void SkipLoad(ILGenerator ilGenerator, Action<ILGenerator> pushReader)
 {
     pushReader(ilGenerator);
     ilGenerator.Call(_skipper);
 }
开发者ID:quyenbc,项目名称:BTDB,代码行数:5,代码来源:SimpleFieldHandlerBase.cs

示例12: LoadToWillLoad

 public void LoadToWillLoad(ILGenerator ilGenerator, Action<ILGenerator> pushReader)
 {
     pushReader(ilGenerator);
     ilGenerator.Call(_loader);
 }
开发者ID:quyenbc,项目名称:BTDB,代码行数:5,代码来源:SimpleFieldHandlerBase.cs

示例13: LoadToSameHandler

 public bool LoadToSameHandler(ILGenerator ilGenerator, Action<ILGenerator> pushReader, Action<ILGenerator> pushThis, Type implType, string destFieldName)
 {
     pushThis(ilGenerator);
     pushReader(ilGenerator);
     ilGenerator.Call(() => ((AbstractBufferedReader)null).ReadVUInt64());
     var fieldInfo = implType.GetField("_FieldStorage_" + destFieldName);
     ilGenerator.Stfld(fieldInfo);
     return true;
 }
开发者ID:quyenbc,项目名称:BTDB,代码行数:9,代码来源:DBObjectFieldHandler.cs

示例14: SkipLoad

 public void SkipLoad(ILGenerator ilGenerator, Action<ILGenerator> pushReader)
 {
     pushReader(ilGenerator);
     ilGenerator.Call(() => ((AbstractBufferedReader)null).SkipVUInt64());
 }
开发者ID:quyenbc,项目名称:BTDB,代码行数:5,代码来源:DBObjectFieldHandler.cs

示例15: AppendReadField

 public override void AppendReadField(ILGenerator il)
 {
     il.Call<MessageReader>("ReadString");
 }
开发者ID:drunkcod,项目名称:ProtoSharp,代码行数:4,代码来源:MessageFieldString.cs


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