XML 注释 - 如何正确引用字典索引器?
顾名思义,我不知道如何引用字典索引器。这里有什么帮助吗? :)
仅供参考,我已经尝试过:
<see cref="Item"/>
<see cref="Item(Int32)"/> //Highly doubted this would work.
<see cref="Item(TKey)"/>
<see cref="Item[TKey]"/>
As the name states, I have no idea how to reference a dictionary indexer. Any help here? :)
FYI, I've tried:
<see cref="Item"/>
<see cref="Item(Int32)"/> //Highly doubted this would work.
<see cref="Item(TKey)"/>
<see cref="Item[TKey]"/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用完整的属性语法来引用索引器:
您可以通过检查生成的 XML 文件来检查属性是否已正确解析:
注意第一个
P:
如何与第二个匹配。最后,确保它可以与 Intellisense 配合使用:
原始海报更新 (myermian):
我做了一点挖掘并发现索引器属性的缩写形式只是“this”。例如:
<参见 cref="this"/>
You can use the full property syntax to reference indexers:
You can check that the property was resolved properly by inspecting the generated XML file:
Notice how the first
P:
matches the second one.Finally, make sure it's working with Intellisense:
Update by Original Poster (myermian):
I did a little bit of digging and have discovered that the shortform of an indexer property is just "this". Ex:
<see cref="this"/>
尝试
(名称是 Item,而不是 Items)Try
<see cref="P:Item(System.Int32)" />
(the name is Item, not Items)