This is probably a stupid question, but here goes. I have this statement in my program:
// No node should be shown as selected
mdxTreeList.Selection.Set(new TreeListNode[0]);
The variable mdxTreeList is an instance of the DevExpress XtraTreeList.TreeList control, and TreeListNode is the name of another DevExpress class. But what exactly does the syntax “new TreeListNode[0]” mean? I would have thought it was a syntax error, but it works fine. (If I remember right, this statement originally came from a DevExpress sample program.)
It’s a one-dimensional array with zero length (i.e. zero members). The type is
TreeListNode[].Some people prefer to write the same thing as
new TreeListNode[] { }but that’s just a matter of taste.By the way, since
staticindexers are not allowed in C#, there’s no possibility this could be an indexer access. (Of course indexers are meant to “look like” arrays, so it is not by accident that both use square bracket[]syntax.)