While searching for C#'s equivalent to Java's Hashmap, I came across a sliver of code that I've never seen before. Was hoping someone could explain the signature of the property definition in this class.
public class NullableDictionnary : Dictionary<string, string>
{
string null_value;
public StringDictionary this[string key]
{
get
{
if (key == null)
{
return null_value;
}
return base[key];
}
set
{
if (key == null)
{
null_value = value;
}
else
{
base[key] = value;
}
}
}
}
Specifically, what is meant by this[string key]
?