FluentIL:ILGenerator的薄流利包装纸(Reflection.Emit)

时间:2021-05-17 04:31:59
【文件属性】:
文件名称:FluentIL:ILGenerator的薄流利包装纸(Reflection.Emit)
文件大小:17KB
文件格式:ZIP
更新时间:2021-05-17 04:31:59
C# 流利的 围绕System.Reflection.Emit.ILGenerator薄而流畅的包装器,用于动态生成IL代码。 ILGenerator有一个非常基本的API。 除了一些辅助方法外,您需要使用的只是Emit方法的许多重载,您可以在其中传递操作码和操作数。 没有指示应该为哪种操作码传递哪种类型的操作数,您必须查看文档。 另外,代码非常冗长。 例如,如果要为仅将其参数存储在字段中的非常基本的构造函数生成主体,则最终将获得以下代码: var il = ctor.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Call, typeof(object).GetConstructor(Type.EmptyTypes)); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldarg
【文件预览】:
FluentIL-master
----.gitignore(3KB)
----README.md(1KB)
----FluentIL()
--------IILLogger.cs(1KB)
--------FluentILGenerator.cs(10KB)
--------ILGeneratorExtensions.cs(297B)
--------FluentILGenerator.Opcodes.cs(47KB)
--------IFluentILGenerator.Opcodes.cs(10KB)
--------FormatUtils.cs(2KB)
--------FluentIL.csproj(3KB)
--------IFluentILGenerator.cs(2KB)
--------FluentILGenerator.Opcodes.tt(4KB)
--------Properties()
--------ILLogger.cs(4KB)
----FluentIL.sln.DotSettings(414B)
----FluentIL.sln(969B)
----.gitattributes(2KB)

网友评论