Question

I saw this signature on the ListView class:

public ListView..::.ListViewItemCollection Items { get; }

When I saw that, "What?!"

I searched "dot dot colon colon dot" and "..::." on Google with no result.

alt text

Was it helpful?

Solution

That's not C#; that's JScript. In C#, it would be:

public ListView.ListViewItemCollection Items { get; }

It's a little different because ListViewItemCollection is an inner class of ListView.

I'm guessing that you saw this looking at ListView.Items Property (System.Windows.Forms).

If you look at the listing for all the other languages, they're all listed with the JScript syntax. You've found a documentation bug.

OTHER TIPS

ListViewItemCollection is a nested type of ListView, which means that in the code, the Collection class is defined inside of the ListView definition, like so:

public class ListView {
  public ListViewItemCollection Items {get;}

  public class ListViewItemCollection : IList {
    // more code here
  }
}

I would assume that it is coded this way just to keep their source tree a little bit cleaner. This way, all of the helper collection classes that are associated with the ListView control aren't scattered throughout the directory. Inner classes do have a few special characteristics, but none that I can imagine would apply here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top