如何转换机具代码? [英] How to convert Implements code?

查看:62
本文介绍了如何转换机具代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我想知道如何转换此VB.NET代码:

Hi there. I''m wondering how I would convert this VB.NET code:

Implements FongPlugins



进入C#吗?

原始代码正在实现一个名为FongPlugins的接口,该接口出现在引用/导入的dll中.



into C#?

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

Thanks in advance!

推荐答案

这告诉我,您不了解在C#中定义类的基础.
This tells me you don''t know the basics of defining a class in C#.

public class MyClass : FondPlugins
{
}


原始代码正在实现一个名为FongPlugins的接口,该接口出现在引用/导入的dll中.
实施FongPlugins

上面的代码显示了继承的使用.在C#中:
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#:
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.
}


实现是VB.Net中的关键字,用于继承接口.但是在C#中,没有不同的关键字可用于继承.只需使用冒号运算符即可继承,即:

例子:

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 :

class myclass : FongPlugins



参考: http://msdn.microsoft.com/en-us/library /aa288461(v=vs.71).aspx [ ^ ]



Ref : http://msdn.microsoft.com/en-us/library/aa288461(v=vs.71).aspx[^]


这篇关于如何转换机具代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆