P
Peter Berry
I was surprised and somewhat disappointed by the fact that you cannot declare types in an interface. I discovered this when defining an interface that included events, where the definition of the delegates had to be placed outside the definition of the interface. To me, the delegate definition is an integral part of the interface definition. Also, I could imagine cases where one would like to define enums and structs in interfaces as well (to be used as parameter types in methods of the interface). The way it is now, these "external" definitions have to be carried along as added baggage to the interfaces, and clients have to be aware of this. They are even listed separately from the interface in the Class View tree list in Visual Studio - unless the type is given some meaningful name tag to associate it with its interface, there is no indication as to what it belongs to.
Am I missing something here, or is this a reasonable request for inclusion in a future version of the language? I would very much appreciate your comments on this.
Peter Berry
Am I missing something here, or is this a reasonable request for inclusion in a future version of the language? I would very much appreciate your comments on this.
Peter Berry