Doing some code reading and stumbled upon this snippet that I haven't seen before:
public SomeClass {
public someInterface this[String strParameter] {
get {
return SomeInternalMethod(strParameter);
}
}
}
It looks like it is called as follows:
SomeClass _someClass = new SomeClass();
SomeInterface returnedValue = _someClass["someString"];
I am interested in where this function would be appropriate or what the intent of writing in this style. For example why would this be preferred over simply calling the function?