我在 ListView 类中看到了这个签名:
public ListView..::.ListViewItemCollection Items { get; }
当我看到那个的时候,“什么?!”
我在Google上搜索“dot dot colon colon dot”和“..::.”,但没有结果。
我在 ListView 类中看到了这个签名:
public ListView..::.ListViewItemCollection Items { get; }
当我看到那个的时候,“什么?!”
我在Google上搜索“dot dot colon colon dot”和“..::.”,但没有结果。
那不是C#,那是JScript。在C#中,它应该是这样的:
public ListView.ListViewItemCollection Items { get; }
由于 ListViewItemCollection
是 ListView
的内部类,所以有些不一样。
我猜你是在看 ListView.Items 属性 (System.Windows.Forms)。
如果你查看其他语言的列表,它们都使用 JScript 语法。你发现了一个文档错误。
ListViewItemCollection是ListView的嵌套类型,这意味着在代码中,集合类被定义在ListView定义内部,如下所示:
public class ListView {
public ListViewItemCollection Items {get;}
public class ListViewItemCollection : IList {
// more code here
}
}