0

When I read a source code C#, I see a line

return new Form(ElementType.Checkbox, ((IHTMLInputElement)htmlElement).@checked);  

But I can NOT find it with keyword .@checked.
Could you please tell me what is .@checked called and its meaning?

Update answer
Firstly, Thanks @Yeldar Kurmangaliyev, @Erik Funkenbusch and @TcKs.
Secondly, I'm sorry for making duplicate post. Because I searched with ".@checked" and saw nothing.
Finally, I understood that @ sign help define a variable whose name is as same as C# keyword, like this:

string @string = "This is a string";
string str = @string; // str = "This is a string"
GSP
  • 574
  • 3
  • 7
  • 34
  • 2
    It is just a property / member named `checked`. However, `checked` is C# keyword, so you have to use `@` to tell compiler that it is just member name. – Yeldar Kurmangaliyev Apr 19 '17 at 03:50

1 Answers1

1

The checked is keyword in C# and therefore the name must be prefixed with @ as documentation says:

Keywords are predefined, reserved identifiers that have special meanings to the compiler. They cannot be used as identifiers in your program unless they include @ as a prefix. For example, @if is a valid identifier but if is not because if is a keyword.

So ((IHTMLInputElement)htmlElement).@checked) means accessing the checked member on instance of class implementing IHTMLInputElement.

TcKs
  • 25,849
  • 11
  • 66
  • 104