Domanda

I simply need to know the "requires" syntax for a C# class interface. If I have a class like this:

public interface IGroupNode : ISceneNode

How can I make the interface require the implementation of IEnumerable? I think this is very simple and just a syntax thing, but feel free to prove me wrong.

Update:

public interface IGroupNode : ISceneNode, IEnumerable<ISceneNode>

Now I'm confused on where to implement IEnumerable? I have no concrete class implementation of ISceneNode. Should I do it in the concrete class implementation of IGroupNode instead?

È stato utile?

Soluzione

public interface IGroupNode : ISceneNode, IEnumerable

Just like you did with your other interface.

Altri suggerimenti

public interface IGroupNode : ISceneNode, IEnumerable
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top