Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is this syntax: using "this" in property in C#?

Tags:

c#

I happened to read this line of code:

public MyArray this [int index]{
    get{
        return array[index];
    }
}

Where can I find the document on msdn about the syntax of using "this" in property?

And is there any book covers this kind of tricky syntax of C# other than the common stuff?

like image 287
zs2020 Avatar asked Jul 12 '10 02:07

zs2020


1 Answers

It's an indexer.

like image 70
Steven Sudit Avatar answered Nov 12 '22 23:11

Steven Sudit