有两个项目,一个C++ CLI与另一个C#项目。
在C#项目中引用C++ CLI程序集。为什么C++ CLI索引属性在C#中不起作用?
一切都很好,除了索引属性不起作用。
C++ CLI代码:
property Nullable< int> PVarInt[System::String^] {
Nullable<int> get(System::String^ inx){
}
void set(System::String^ inx, Nullable< int> newx){
}
}
在C#中该代码显示为两个set和get方法类似如下:
get_PVarInt(..)
set_PVarInt(..)
这是一个错误?有没有解决这个问题的方法?为什么发生这一切?
>使用该主叫机制,但很少不安全。 System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName =“App.exe”; process.StartInfo.Arguments =“arg1 arg2 arg3”;的Process.Start(); – XEENA 2013-03-12 11:04:04
我写了一篇关于在将VB.NET应用程序转换为C#时创建的类的博客文章,它可能对您有用。 [PropertyWrapper](http://4a47.blogspot.se/2013/03/propertywrapper.html) – 2013-03-12 12:17:24
@JensGranlund有用,谢谢 – 2013-03-12 12:28:25