IronPython如何将对象传递给需要接口的C#方法?

时间:2015-04-13 22:52:07

标签: c# .net clr ironpython fix-protocol

我试着打电话 public SocketInitiator(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory)

现在第二个参数是一个接口:

namespace QuickFix
{
    public interface MessageStoreFactory
    {
        MessageStore Create(SessionID sessionID);
    }  
public class MemoryStoreFactory : MessageStoreFactory {...}
}

我试图传递一个接口的实例: msf1=QuickFix.MemoryStoreFactory() init=QuickFix.Transport.SocketInitiator(osa, msf1, ss, screenlog) 但是我得到了相当无益的错误

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: expected MessageStoreFactory, got MemoryStoreFactory

有没有办法向C#/ CLR标识我已经传递了一个实现MessageStoreFactory实例的类的Python实例?或者这是其他一些无关的问题吗?

0 个答案:

没有答案