Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个索引器的显式接口成员实现的工作示例程序。
微软的索引器 c# 文档指出这是可能的,但没有提供一个工作示例(至少对我来说这个示例不起作用)。我需要一个可以做到这一点的工作程序。
文档似乎是错误的。我现在无法检查它,我不记得曾经明确实现过索引器,但这应该可行:
interface IInterface { ReturnType this[int index] { get; } } class Foo: IInterface { ReturnType IInterface.this[int index] { get { return ... } } }