using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
namespace Serein.Library.Utils
{
///
/// Emit创建委托工具类
///
public class EmitHelper
{
///
/// 动态方法信息
///
public class EmitMethodInfo
{
///
/// 方法声明类型
///
public Type DeclaringType { get; set; }
///
/// 方法类型
///
public EmitMethodType EmitMethodType { get; set; }
///
/// 是异步方法
///
public bool IsAsync { get; set; }
///
/// 是静态的
///
public bool IsStatic { get; set; }
public bool HasByRefParameters { get; set; }
public int[] ByRefParameterIndexes { get; set; } = [];
}
///
/// 方法类型枚举
///
public enum EmitMethodType
{
///
/// 普通的方法。如果方法返回void时,将会返回null。
///
Func,
///
/// 无返回值的异步方法
///
Task,
///
/// 有返回值的异步方法
///
TaskHasResult,
}
static Task