O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Member Access

One thing we’ve been dealing with all the time without giving it explicit attention is the concept of member access, indicated by the period (.) token:

Console.WriteLine("Hello");person.Age = 26;placeOrder.Click += placeOrder_Click;

Here we’re respectively looking up a method, a property, and an event using the member access. Members are what types consist of and are accessible either through the type itself (as in the first case, called a static method) or through a type’s instances (as in the latter two cases). Fields can be accessed in a similar way.

Note: Generics

Sometimes member access is paired with the specification of type arguments in the context of generics. A method itself may need a type argument, which is specified ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required