bingham
Interface practices
Apologies for the dumb question, I've been out of C# for more than a decade, and I have the unenviable task of porting some template-heavy C++ code to C#. My googling has failed to get results because I'd call what I want to do "delegation", and, well, that name is already taken...
Anyway, I've got a class that has C++ multiple inheritance, and I need to reproduce the functionality in C#. So, I add an interface to (at least one) base class, have the derived class derive from the interface, and add a field to the derived class containing the implementation of the interface.
My question is -- is there a way to tell the compiler "refer this interface to this field that implements the interface" as a single... operation? concept? without writing out stubs for all methods in the interface?
14 replies