I don't understand this C# code:
public virtual object this[string fullname]
{
get
{
return null;
}
set
{
}
}
Specifically the this[string name] part. What is the person intending this code to do? Here is how it's implemented later:
public override object this[string fullname]
{
get
{
fullname= fullname.Trim('\"');
//some code ....
return x;
}
set
{
fullname= fullname.Trim('\"');
//some code ...
string[] a= fullname.Split(":".ToCharArray());
//some more code...
}
}
Is the person redefining the this keyword whenever it's used by the class that has this code? Is that what's going on? If so why?