Hey, I've been trawling documentation for this, but can't figure out what it's called so I'm running short of answers:
In VB say you build some interface:
Now, you get as far as implementing that interface:
Now, as soon as you hit enter after typing the interface name that you're implementing, it automatically populates the class with the relevant methods required to implement that class:
So, I've just realised that this appears not to work in C# causing me a huge and largely unecessary amount of typing. Is there a way of forcing this to work? I thought about writing a macro to parse the interface and add the methods into my code, but it seems like a lot of work for something that at least in my mind should be automatic. Does anyone know what this process of automatically writing out the interface methods in your class is called? Maybe if I had that magic keyword, I could figure out the rest myself.
In VB say you build some interface:
Code:
Interface IDemoInterface Sub MyFirstMethod(ByVal Param1 As String) Sub MySecondMethod(ByVal Param1 As String) Sub MyThirdMethod(ByVal Param1 As Integer) End Interface
Code:
Public Class DemoImplementsInterface Implements IDemoInterface
Code:
Public Class DemoImplementsInterface Implements IDemoInterface Public Sub MyFirstMethod(ByVal Param1 As String) Implements IDemoInterface.MyFirstMethod End Sub Public Sub MySecondMethod(ByVal Param1 As String) Implements IDemoInterface.MySecondMethod End Sub Public Sub MyThirdMethod(ByVal Param1 As Integer) Implements IDemoInterface.MyThirdMethod End Sub End Class
Comment