How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
来源:互联网 发布:安卓看美漫的软件 编辑:程序博客网 时间:2024/05/17 01:17
显式接口实现还允许程序员实现具有相同成员名称的两个接口,并为每个接口成员各提供一个实现。本示例同时以公制单位和英制单位显示框的尺寸。Box 类实现 IEnglishDimensions 和 IMetricDimensions 两个接口,它们表示不同的度量系统。两个接口有相同的成员名称 Length 和 Width。
可靠编程
如果希望默认度量采用英制单位,请正常实现 Length 和 Width 这两个方法,并从 IMetricDimensions 接口显式实现 Length 和 Width 方法:
这种情况下,可以从类实例访问英制单位,而从接口实例访问公制单位:
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members (C# Programming Guide)
- How to implement inheritance in JavaScript
- How to: Implement Interface Events
- Interface Properties (C# Programming Guide)
- How to: Use a Thread Pool (C# Programming Guide)
- 显式实现接口(Implement Interface explicitly)
- 显式实现接口(Implement Interface explicitly)
- How to implement COMET with PHP
- 转:How to implement COMET with PHP
- How to implement COMET with PHP
- How to implement DynamicMBean with custom annotation
- how to use a SQLite database in a standalone program with an HTML interface and VBScript as the programming language
- How to use composition and inheritance in visual c# ?
- Android 使用Mobclix实现广告盈利(http://www.javaeye.com/topic/609639)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- 终于弄好了ubuntu下的latex中文编辑
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- 单链表逆序
- 提供综合分析数据
- 而逐渐转向以4C'
- DirectShow - VMR-9 Allocator
- 清华大学校长留给毕业生的一段话
- mysql查询语句优化命令mysql explain
- unistd.h在windows下面是没有的
- 调整更改ubuntu时区,时间,locale