是否可以编写一个 C# 程序集,该程序集在加载时会将方法从另一个程序集中注入到一个类中?如果是,注入的方法是否可以从使用 DLR 的语言(如 IronPython)中获得?
namespace IronPython.Runtime
{
public class Bytes : IList<byte>, ICodeFormattable, IExpressionSerializable
{
internal byte[] _bytes;
//I WANT TO INJECT THIS METHOD
public byte[] getbytes()
{
return _bytes;
}
}
}
我需要那个方法,如果可能的话,我想避免重新编译 IronPython。