That’s pretty much the whole question. I’ve installed Visual C# 2008 Express on a clean Windows XP Pro SP3 machine, started a new Windows Forms project, double-clicked the form to create a Form1_Load method, then typed:
StringBuilder SB; SB = new StringBuilder('test'); SB.Chars
but Chars doesn’t appear on the autocomplete menu. Why not?
It’s the indexer, which you reference with
foo[bar]syntax instead offoo.Chars(bar):C# doesn’t use the names of indexers, nor can it use multiple indexers with the same parameters which are named differently (created in a different language).
Most of the time this is okay, but just occasionally I wish it supported named indexers fully…