Chapter 10

Defining Class Members

WHAT YOU WILL LEARN IN THIS CHAPTER

  • How to define class members
  • How to use the class diagram to add members
  • How to control class member inheritance
  • How to define nested classes
  • How to implement interfaces
  • How to use partial class definitions
  • How to use the Call Hierarchy window

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=9781118314418 on the Download Code tab. The code is in the Chapter 10 download and individually named according to the names throughout the chapter.

This chapter continues exploring class definitions in C# by looking at how you define field, property, and method class members. You start by examining the code required for each of these types, and learn how to generate the structure of this code using wizards. You also learn how to modify members quickly by editing their properties.

After covering the basics of member definition, you’ll learn some advanced techniques involving members: hiding base class members, calling overridden base class members, nested type definitions, and partial class definitions.

Finally, you put theory into practice by creating a class library that you can build on and use in later chapters.

MEMBER DEFINITIONS

Within a class definition, you provide definitions for all members of the class, including fields, methods, and properties. All members have their own accessibility levels, defined in all cases by one of the ...

Get Beginning Visual C# 2012 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.