2.13.txt
来自「《Microsoft Visual C# .NET 2003开发技巧大全》源代码」· 文本 代码 · 共 32 行
TXT
32 行
Listing 2.13 Implementing Multiple Interfaces
using System;
namespace _12_MultipleInterfaces
{
// interface declarations omitted
public class Radio : IVolumeControl, IChannelControl
{
int IVolumeControl.Current
{
get
{
return 1;
}
}
int IChannelControl.Current
{
get
{
return 2;
}
}
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
IChannelControl radioDial = (IChannelControl) new Radio();
Console.WriteLine( “Current Channel = {0}”, radioDial.Current );
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?