Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there. I'm wondering how I would convert this VB.NET code:

VB
Implements FongPlugins


into C#?

The original code is implementing an interface named FongPlugins that appears in a referenced/imported dll.

Thanks in advance!
Posted

This tells me you don't know the basics of defining a class in C#.

public class MyClass : FondPlugins
{
}
 
Share this answer
 
Comments
drummerboy0511 8-May-12 10:32am    
You would be right. I understand C# to a degree, but certainly not enough to build a full-blown program just yet.
The original code is implementing an interface named FongPlugins that appears in a referenced/imported dll.
Implements FongPlugins

The above code shows the use of Inheritance. In C#:
C#
myClass : FondPlugins
{
   // Implement the FondPlugins abstract methods if any 
   // Override the virtual methods of FondPlugins if needed
   // If it was an interface, you need to implement the methods defined in the interface.
}
 
Share this answer
 
Comments
Monjurul Habib 8-May-12 16:39pm    
5!
implements is keyword in VB.Net for inheriting an interface. but in C# there is not different keyword to be used for inheritence. Simply inherit using colon operator i.e. :

Example :

C#
class myclass : FongPlugins


Ref : http://msdn.microsoft.com/en-us/library/aa288461(v=vs.71).aspx[^]
 
Share this answer
 
Comments
Monjurul Habib 8-May-12 16:39pm    
5!
You've been given the answer on how to implement this interface in terms of declaring it in the class definition. You still have some work to do though as you have to actually implement the interface methods. Given that you have this to do, how could you get a head start? Well, one way - if you aren't familiar with C# - would be to use a C# to VB.NET (and vice versa) converter. It's a good way to get an understanding of some of the language constructs, even if it won't make you familiar in all their nuances overnight.

A fairly decent converter can be found here[^].
 
Share this answer
 
Comments
Monjurul Habib 8-May-12 16:39pm    
5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900