The following example shows how to implement interface indexers.
下列范例将示范如何实作介面索引子。
For more information about how to use indexers with an interface, see interface indexers.
有关如何对接口使用索引器的更多信息,请参见接口索引器。
An interface can specify methods, properties, events, and indexers for classes to implement.
一个接口可以为将要实现的类指定方法、属性、事件、和索引器。
Indexers are a syntactic convenience that enable you to create a class, struct, or interface that client applications can access just as an array.
索引器在语法上方便您创建客户端应用程序可将其作为数组访问的类、结构或接口。
Properties and indexers of a class can define extra accessors for a property or indexer defined on an interface.
属性和索引器的类可以定义额外的属性或索引器在接口上定义的访问器。
Properties and indexers on a class can define extra accessors for a property or indexer defined on an interface.
类的属性和索引器可以为接口上定义的属性或索引器定义额外的访问器。
The signature of an indexer must differ from the signatures of all other indexers declared in the same interface.
一个索引器的签名必须区别于在同一接口中声明的其他所有索引器的签名。
The signature of an indexer must differ from the signatures of all other indexers declared in the same interface.
一个索引器的签名必须区别于在同一接口中声明的其他所有索引器的签名。
应用推荐