13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 14 ExpressionsConstruct Example DescriptionEvent accessIndexeraccessOperatorinvocationT.PT.P = valuee.Pe.P = valueE += valueE -= valueT.E += valueT.E -= valuee.E += valuee.E -= valuee[x, y]e[x, y] = valueThe get accessor of the property P in the class or struct T isinvoked. A compile-time error occurs if P is not static or if Pis write-only.The set accessor of the property P in the class or struct T isinvoked with the argument list (value). A compile-time erroroccurs if P is not static or if P is read-only.The get accessor of the property P in the class, struct, orinterface given by the type of e is invoked with the instanceexpression e. A compile-time error occurs if P is static or ifP is write-only.The set accessor of the property P in the class, struct, orinterface given by the type of e is invoked with the instanceexpression e and the argument list (value). A compile-timeerror occurs if P is static or if P is read-only.The add accessor of the event E in the containing class or structis invoked. If E is not static, the instance expression is this.The remove accessor of the event E in the containing class orstruct is invoked. If E is not static, the instance expression isthis.The add accessor of the event E in the class or struct T isinvoked. A compile-time error occurs if E is not static.The remove accessor of the event E in the class or struct T isinvoked. A compile-time error occurs if E is not static.The add accessor of the event E in the class, struct, or interfacegiven by the type of e is invoked with the instance expressione. A compile-time error occurs if E is static.The remove accessor of the event E in the class, struct, orinterface given by the type of e is invoked with the instanceexpression e. A compile-time error occurs if E is static.Overload resolution is applied to select the best indexer in theclass, struct, or interface given by the type of e. The getaccessor of the indexer is invoked with the instance expressione and the argument list (x, y). A compile-time error occurs ifthe indexer is write-only.Overload resolution is applied to select the best indexer in theclass, struct, or interface given by the type of e. The setaccessor of the indexer is invoked with the instance expressione and the argument list (x, y, value). A compile-time erroroccurs if the indexer is read-only.-x Overload resolution is applied to select the best unary operatorin the class or struct given by the type of x. The selectedoperator is invoked with the argument list (x).x + yOverload resolution is applied to select the best binary operatorin the classes or structs given by the types of x and y. Theselected operator is invoked with the argument list (x, y).131

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!