2

I have a C++/CLI generic interface like this :

using namespace System::Collections::Generic;
namespace Test
{
    generic <class T>
    public interface class IElementList
    {
         property List<T>^ Elements;
    };
}

and I want to implement it in a C# generic interface like this :

using Test;
namespace U
{
    public interface IElementLightList<T> : IElementList<T>
        where T : IElementLight
    {
        bool isFrozen();
        bool isPastable();
    }
}

This don't work, Visual Studio is not able to see C++/CLI IElementList interface ! I tested with a not generic C++/CLI interface and this work.

What I missed ?

4

1 回答 1

2

您声明了一个没有任何访问器方法的属性。你至少需要一个吸气剂:

generic <class T>
    public interface class IElementList {
        property List<T>^ Elements {
            List<T>^ get();
        }
    };
于 2013-11-08T09:51:08.297 回答