I’ve been trying this a few different ways, but I’m reaching the conclusion that it can’t be done. It’s a language feature I’ve enjoyed from other languages in the past. Is it just something I should just write off?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, static indexers aren’t supported in C#. Unlike other answers, however, I see how there could easily be point in having them. Consider:
It would be relatively rarely used, I suspect, but I think it’s odd that it’s prohibited – it gives asymmetry for no particular reason as far as I can see.