【发布时间】:2010-02-21 07:41:29
【问题描述】:
我的应用程序由带有非托管 C dll 调用的 C# 代码组成。 在我的 C# 代码中,我有一个对象/类,其中它的属性都是系统类型,例如字符串和 int 以及我定义的其他对象。
我想将这个复杂的 (Graph.cs) 对象传递给我的 C (dll) 代码,你会在这里建议什么实现?
我尝试过移动结构,但除了字符串和 int 之外,我没有这样做。
谢谢。
代码:
public Class Grpah {
TupleCollection m_TupleCollection;
int m_nGeneralIndex;
bool m_bPrintWRF;
string m_sLink;
}
public Class TupleCollection {
IList<Tuple> _collection;
}
public Class Tuple {
Globals.TupleType m_ToppleType;
ArrayList m_Parameters;
}
public class TupleArgs {
public string Value { get; set; }
public Globals.PAS PAS;
public RefCollection RefCollection { get; set; }
public int Time{ get; set; }
}
public class RefCollection {
public List<int> SynSet{ get; set; }
public Globals.PAS PAS;
}
【问题讨论】:
-
您需要提供您的代码,以便人们可以提供建议。
-
我已经添加了代码,是否可以将 Graph 对象发送到 C dll?