Description
Efnisyfirlit
- Welcome
- Cover
- Cover
- Inside Front Cover
- Front Matter
- Title Page
- Copyright Page
- Brief Contents
- Contents
- Locations of VideoNotes
- Preface
- Attention Students
- 1: Introduction to Computers and Programming
- Introduction: Introduction to Computers and Programming
- 1.1: Introduction
- 1.1: Introduction
- 1.2: Hardware and Software
- 1.2: Hardware and Software
- 1.2.1: Software
- 1.3: How Computers Store Data
- 1.3: How Computers Store Data
- 1.3.1: Storing Numbers
- 1.3.2: Storing Characters
- 1.3.3: Advanced Number Storage
- 1.3.4: Other Types of Data
- 1.4: How a Program Works
- 1.4: How a Program Works
- 1.4.1: From Machine Language to Assembly Language
- 1.4.2: High-Level Languages
- 1.4.3: Keywords, Operators, and Syntax: An Overview
- 1.4.4: Compilers and Interpreters
- 1.5: Graphical User Interfaces
- 1.5: Graphical User Interfaces
- 1.5.1: Event-Driven GUI Programs
- 1.6: Objects
- 1.6: Objects
- 1.6.1: Visible versus Invisible Objects
- 1.6.2: Classes: Where Objects Come From
- 1.6.3: .NET
- 1.6.4: Writing Your Own Classes
- 1.7: The Program Development Process
- 1.7: The Program Development Process
- 1.8: Getting Started with Visual Studio
- 1.8: Getting Started with Visual Studio
- 1.8.1: Installing the Student Sample Program Files
- 1.8.2: Creating a New Project
- 1.8.3: The Visual Studio Environment
- 1.8.4: Using Auto Hide
- 1.8.5: The Menu Bar and the Standard Toolbar
- 1.8.6: The Toolbox
- 1.8.7: Using ToolTips
- 1.8.8: Docked and Floating Windows
- 1.8.9: Projects and Solutions
- 1.8.10: Typical Organization of Solutions and Projects on the Disk
- 1.8.11: Opening an Existing Project
- 1.8.12: Displaying the Designer (When It Does Not Automatically Appear)
- 1.8.13: Accessing the Visual Studio Documentation
- Chapter 1: Key Terms
- Chapter 1: Key Terms
- Chapter 1: Review Questions
- Chapter 1: Review Questions
- Chapter 1: Programming Problems
- Chapter 1: Programming Problems
- 2: Introduction to Visual C#
- Introduction: Introduction to Visual C#
- 2.1: Getting Started with Forms and Controls
- 2.1: Getting Started with Forms and Controls
- 2.1.1: The Application’s Form
- 2.1.2: Identifying Forms and Controls by Their Names
- 2.1.3: The Properties Window
- 2.1.4: Adding Controls to a Form
- 2.1.5: More about Button Controls
- 2.1.6: Changing a Control’s Name
- 2.1.7: Rules for Naming Controls
- 2.2: Creating the GUI for Your First Visual C# Application: The Hello World Application
- 2.2: Creating the GUI for Your First Visual C# Application: The Hello World Application
- 2.3: Introduction to C# Code
- 2.3: Introduction to C# Code
- 2.3.1: Switching between the Code Editor and the Designer
- 2.3.2: Adding Your Own Code to a Project
- 2.3.3: Message Boxes
- 2.3.4: String Literals
- 2.3.5: Multiple Buttons with Event Handlers
- 2.3.6: Design Time and Run Time
- 2.4: Writing Code for the Hello World Application
- 2.4: Writing Code for the Hello World Application
- 2.5: Label Controls
- 2.5: Label Controls
- 2.5.1: The Font Property
- 2.5.2: The BorderStyle Property
- 2.5.3: The AutoSize Property
- 2.5.4: The TextAlign Property
- 2.5.5: Using Code to Display Output in a Label Control
- 2.6: Making Sense of IntelliSense
- 2.6: Making Sense of IntelliSense
- 2.7: PictureBox Controls
- 2.7: PictureBox Controls
- 2.7.1: The SizeMode Property
- 2.7.2: Creating Clickable Images
- 2.7.3: The Visible Property
- 2.7.4: Sequential Execution of Statements
- 2.8: Comments, Blank Lines, and Indentation
- 2.8: Comments, Blank Lines, and Indentation
- 2.8.1: Using Blank Lines and Indentation to Make Your Code Easier to Read
- 2.9: Writing the Code to Close an Application’s Form
- 2.9: Writing the Code to Close an Application’s Form
- 2.10: Dealing with Syntax Errors
- 2.10: Dealing with Syntax Errors
- Chapter 2: Key Terms
- Chapter 2: Key Terms
- Chapter 2: Review Questions
- Chapter 2: Review Questions
- Chapter 2: Programming Problems
- Chapter 2: Programming Problems
- 3: Processing Data
- Introduction: Processing Data
- 3.1: Reading Input with TextBox Controls
- 3.1: Reading Input with TextBox Controls
- 3.1.1: Clearing the Contents of a TextBox Control
- 3.2: A First Look at Variables
- 3.2: A First Look at Variables
- 3.2.1: Data Type
- 3.2.2: Variable Name
- 3.2.3: string Variables
- 3.2.4: String Concatenation
- 3.2.5: Declaring Variables before Using Them
- 3.2.6: Local Variables
- 3.2.7: Scope of a Variable
- 3.2.8: Lifetime of a Variable
- 3.2.9: Duplicate Variable Names
- 3.2.10: Assignment Compatibility
- 3.2.11: A Variable Holds One Value at a Time
- 3.2.12: Initializing Variables
- 3.2.13: Declaring Multiple Variables with One Statement
- 3.3: Numeric Data Types and Variables
- 3.3: Numeric Data Types and Variables
- 3.3.1: Numeric Literals
- 3.3.2: Assignment Compatibility for int Variables
- 3.3.3: Assignment Compatibility for double Variables
- 3.3.4: Assignment Compatibility for decimal Variables
- 3.3.5: Explicitly Converting Values with Cast Operators
- 3.3.6: Declaring Local Variables with the var Keyword
- 3.4: Performing Calculations
- 3.4: Performing Calculations
- 3.4.1: The Order of Operations
- 3.4.2: Grouping with Parentheses
- 3.4.3: Mixing Data Types in a Math Expression
- 3.4.4: Integer Division
- 3.4.5: Combined Assignment Operators
- 3.5: Inputting and Outputting Numeric Values
- 3.5: Inputting and Outputting Numeric Values
- 3.5.1: Displaying Numeric Values
- 3.5.2: Implicit String Conversion with the + Operator
- 3.6: Formatting Numbers with the ToString Method
- 3.6: Formatting Numbers with the ToString Method
- 3.6.1: Number Format
- 3.6.2: Fixed-Point Format
- 3.6.3: Exponential Format
- 3.6.4: Currency Format
- 3.6.5: Using Percent Format
- 3.6.6: Specifying the Precision
- 3.6.7: Rounding
- 3.6.8: Using Leading Zeros with Integer Values
- 3.7: Simple Exception Handling
- 3.7: Simple Exception Handling
- 3.7.1: Handling Exceptions
- 3.7.2: Displaying an Exception’s Default Error Message
- 3.8: Using Named Constants
- 3.8: Using Named Constants
- 3.9: Declaring Variables as Fields
- 3.9: Declaring Variables as Fields
- 3.9.1: The Lifetime of a Field in a Form Class
- 3.9.2: Precautions
- 3.9.3: Constant Fields
- 3.10: Using the Math Class
- 3.10: Using the Math Class
- 3.10.1: The Math.PI and Math.E Named Constants
- 3.11: More GUI Details
- 3.11: More GUI Details
- 3.11.1: Controlling a Form’s Tab Order
- 3.11.2: Changing the Focus with the Focus Method
- 3.11.3: Assigning Keyboard Access Keys to Buttons
- 3.11.4: The BackColor Property
- 3.11.5: The ForeColor Property
- 3.11.6: Setting Colors in Code
- 3.11.7: Background Images for Forms
- 3.11.8: Organizing Controls with GroupBoxes and Panels
- 3.12: Using the Debugger to Locate Logic Errors
- 3.12: Using the Debugger to Locate Logic Errors
- Chapter 3: Key Terms
- Chapter 3: Key Terms
- Chapter 3: Review Questions
- Chapter 3: Review Questions
- Chapter 3: Programming Problems
- Chapter 3: Programming Problems
- 4: Making Decisions
- Introduction: Making Decisions
- 4.1: Decision Structures and the if Statement
- 4.1: Decision Structures and the if Statement
- 4.1.1: Boolean Expressions and Relational Operators
- 4.1.2: Putting It All Together
- 4.2: The if-else Statement
- 4.2: The if-else Statement
- 4.3: Nested Decision Structures
- 4.3: Nested Decision Structures
- 4.3.1: Indentation and Alignment in Nested Decision Structures
- 4.3.2: Testing a Series of Conditions
- 4.3.3: The if-else-if Statement
- 4.4: Logical Operators
- 4.4: Logical Operators
- 4.4.1: The && Operator
- 4.4.2: The || Operator
- 4.4.3: Short-Circuit Evaluation
- 4.4.4: The ! Operator
- 4.4.5: Precedence of the Logical Operators
- 4.4.6: Checking Numeric Ranges with Logical Operators
- 4.5: bool Variables and Flags
- 4.5: bool Variables and Flags
- 4.6: Comparing Strings
- 4.6: Comparing Strings
- 4.6.1: Other String Comparisons
- 4.7: Preventing Data Conversion Exceptions with the TryParse Methods
- 4.7: Preventing Data Conversion Exceptions with the TryParse Methods
- 4.7.1: Validating the Data in Multiple TextBoxes
- 4.8: Input Validation
- 4.8: Input Validation
- 4.9: Radio Buttons and Check Boxes
- 4.9: Radio Buttons and Check Boxes
- 4.9.1: Check Boxes
- 4.9.2: The CheckedChanged Event
- 4.10: The switch Statement
- 4.10: The switch Statement
- 4.11: Introduction to List Boxes
- 4.11: Introduction to List Boxes
- 4.11.1: The SelectedItem Property
- 4.11.2: Determining Whether an Item Is Selected
- 4.11.3: Working with ListBox Controls in Code
- Chapter 4: Key Terms
- Chapter 4: Key Terms
- Chapter 4: Review Questions
- Chapter 4: Review Questions
- Chapter 4: Programming Problems
- Chapter 4: Programming Problems
- 5: Loops, Files, and Random Numbers
- Introduction: Loops, Files, and Random Numbers
- 5.1: The while Loop
- 5.1: The while Loop
- 5.1.1: The while Loop Is a Pretest Loop
- 5.1.2: Counter Variables
- 5.1.3: Infinite Loops
- 5.2: The ++ and −− operators
- 5.2: The ++ and −− operators
- 5.3: The for Loop
- 5.3: The for Loop
- 5.3.1: The for Loop Is a Pretest Loop
- 5.3.2: Declaring the Counter Variable in the Initialization Expression
- 5.3.3: Other Forms of the Update Expression
- 5.3.4: Counting Backward by Decrementing the Counter Variable
- 5.3.5: Avoiding Modifying the Counter Variable in the Body of the for Loop
- 5.4: The do-while Loop
- 5.4: The do-while Loop
- 5.5: Using Files for Data Storage
- 5.5: Using Files for Data Storage
- 5.5.1: Types of Files
- 5.5.2: File Access Methods
- 5.5.3: Filenames and File Objects
- 5.5.4: Writing Data to a File with a StreamWriter Object
- 5.5.5: Writing Data with the Write Method
- 5.5.6: Handling File-Related Exceptions
- 5.5.7: Writing Numeric Data to a Text File
- 5.5.8: Appending Data to an Existing File
- 5.5.9: Specifying the Location of an Output File
- 5.5.10: Reading Data from a File with a StreamReader Object
- 5.5.11: The Read Position
- 5.5.12: Reading Numeric Data from a Text File
- 5.5.13: Reading a File with a Loop and Detecting the End of the File
- 5.5.14: Calculating a Running Total
- 5.6: The OpenFileDialog and SaveFileDialog Controls
- 5.6: The OpenFileDialog and SaveFileDialog Controls
- 5.6.1: The OpenFileDialog Control
- 5.6.2: The SaveFileDialog Control
- 5.7: Random Numbers
- 5.7: Random Numbers
- 5.7.1: Using var To Declare a Random Variable
- 5.7.2: The Next Method
- 5.7.3: The NextDouble Method
- 5.7.4: Random Number Seeds
- 5.8: The Load Event
- 5.8: The Load Event
- Chapter 5: Key Terms
- Chapter 5: Key Terms
- Chapter 5: Review Questions
- Chapter 5: Review Questions
- Chapter 5: Programming Problems
- Chapter 5: Programming Problems
- 6: Modularizing Your Code with Methods
- Introduction: Modularizing Your Code with Methods
- 6.1: Introduction to Methods
- 6.1: Introduction to Methods
- 6.1.1: void Methods and Value-Returning Methods
- 6.2: void Methods
- 6.2: void Methods
- 6.2.1: The Method Header
- 6.2.2: The Method Body
- 6.2.3: Declaring Methods Inside a Class
- 6.2.4: Calling a Method
- 6.2.5: Top–Down Design
- 6.3: Passing Arguments to Methods
- 6.3: Passing Arguments to Methods
- 6.3.1: Argument and Parameter Data Type Compatibility
- 6.3.2: Parameter Variable Scope
- 6.3.3: Passing Multiple Arguments
- 6.3.4: Named Arguments
- 6.3.5: Default Arguments
- 6.3.6: Passing Arguments by Value
- 6.4: Passing Arguments by Reference
- 6.4: Passing Arguments by Reference
- 6.4.1: Using Reference Parameters
- 6.4.2: Using Output Parameters
- 6.5: Value-Returning Methods
- 6.5: Value-Returning Methods
- 6.5.1: Writing Your Own Value-Returning Methods
- 6.5.2: Boolean Methods
- 6.5.3: Using a Boolean Method to Modularize Input Validation
- 6.5.4: Returning a String from a Method
- 6.6: Debugging Methods
- 6.6: Debugging Methods
- Chapter 6: Key Terms
- Chapter 6: Key Terms
- Chapter 6: Review Questions
- Chapter 6: Review Questions
- Chapter 6: Programming Problems
- Chapter 6: Programming Problems
- 7: Arrays and Lists
- Introduction: Arrays and Lists
- 7.1: Value Types and Reference Types
- 7.1: Value Types and Reference Types
- 7.2: Array Basics
- 7.2: Array Basics
- 7.2.1: Using var to Declare Arrays
- 7.2.2: Array Elements and Subscripts
- 7.2.3: Array Element Default Values
- 7.2.4: Working with Array Elements
- 7.2.5: Array Initialization
- 7.2.6: Using a Loop to Step through an Array
- 7.2.7: Invalid Subscripts
- 7.2.8: The Length Property
- 7.2.9: Watching for Off-by-One Errors
- 7.2.10: Using the foreach Loop with Arrays
- 7.2.11: Reassigning an Array Reference Variable
- 7.3: Working with Files and Arrays
- 7.3: Working with Files and Arrays
- 7.3.1: Writing an Array’s Contents to a File
- 7.3.2: Reading Values from a File and Storing Them in an Array
- 7.4: Passing Arrays as Arguments to Methods
- 7.4: Passing Arrays as Arguments to Methods
- 7.4.1: Using ref and out with Array Parameters
- 7.5: Some Useful Array Algorithms
- 7.5: Some Useful Array Algorithms
- 7.5.1: Copying an Array
- 7.5.2: Comparing Arrays
- 7.5.3: Totaling the Values in an Array
- 7.5.4: Averaging the Values in an Array
- 7.5.5: Finding the Highest and Lowest Values in an Array
- 7.5.6: Partially Filled Arrays
- 7.6: Advanced Algorithms for Sorting and Searching Arrays
- 7.6: Advanced Algorithms for Sorting and Searching Arrays
- 7.6.1: The Selection Sort Algorithm
- 7.6.2: The Binary Search Algorithm
- 7.7: Two-Dimensional Arrays
- 7.7: Two-Dimensional Arrays
- 7.7.1: Declaring a Two-Dimensional Array
- 7.7.2: Accessing the Elements in a Two-Dimensional Array
- 7.7.3: Implicit Sizing and Initialization of Two-Dimensional Arrays
- 7.7.4: Getting the Length of a Two-Dimensional Array and Its Dimensions
- 7.7.5: Passing Two-Dimensional Arrays to Methods
- 7.7.6: Summing All the Elements of a Two-Dimensional Array
- 7.7.7: Summing the Rows of a Two-Dimensional Array
- 7.7.8: Summing the Columns of a Two-Dimensional Array
- 7.8: Jagged Arrays
- 7.8: Jagged Arrays
- 7.9: The List Collection
- 7.9: The List Collection
- 7.9.1: Creating a List
- 7.9.2: Initializing a List
- 7.9.3: Using var to Declare a List
- 7.9.4: Adding Items to a List
- 7.9.5: The Count Property
- 7.9.6: Accessing Items in a List
- 7.9.7: Passing a List to a Method
- 7.9.8: Removing Items from a List
- 7.9.9: Inserting an Item
- 7.9.10: Searching for Items in a List
- 7.10: The ImageList Control
- 7.10: The ImageList Control
- Chapter 7: Key Terms
- Chapter 7: Key Terms
- Chapter 7: Review Questions
- Chapter 7: Review Questions
- Chapter 7: Programming Problems
- Chapter 7: Programming Problems
- 8: Text Processing
- Introduction: Text Processing
- 8.1: Introduction
- 8.1: Introduction
- 8.2: Interpolated Strings
- 8.2: Interpolated Strings
- 8.2.1: Placeholder Expressions
- 8.2.2: Formatting Values
- 8.2.3: Specifying the Precision
- 8.2.4: Rounding
- 8.2.5: Specifying a Minimum Field Width
- 8.3: Working with Characters
- 8.3: Working with Characters
- 8.3.1: The char Data Type
- 8.3.2: Retrieving the Individual Characters in a String
- 8.3.3: Character Testing and Conversion Methods
- 8.3.4: Character Case Conversion
- 8.4: Working with Substrings
- 8.4: Working with Substrings
- 8.5: Manipulating Strings
- 8.5: Manipulating Strings
- 8.5.1: Methods for Manipulating Strings
- 8.6: The StringBuilder Class
- 8.6: The StringBuilder Class
- 8.6.1: Capacity and Length
- 8.6.2: Creating a StringBuilder Object
- 8.6.3: Retrieving a StringBuilder Object’s String Value
- 8.6.4: StringBuilder Properties
- 8.6.5: Using Indexes With a StringBuilder Object
- 8.6.6: Appending Data to a StringBuilder
- 8.6.7: Inserting Data Into a StringBuilder
- 8.6.8: Removing Characters from a StringBuilder
- 8.6.9: Replacing Characters and Substrings in a stringBuilder
- 8.6.10: Other StringBuilder Methods
- 8.7: Tokenizing Strings
- 8.7: Tokenizing Strings
- 8.8: Method Chaining
- 8.8: Method Chaining
- 8.9: The String.Format Method
- 8.9: The String.Format Method
- 8.9.1: Formatting the Arguments
- 8.9.2: Specifying a Minimum Field Width
- 8.9.3: Specifying the Precision
- 8.9.4: Rounding
- Chapter 8: Key Terms
- Chapter 8: Key Terms
- Chapter 8: Review Questions
- Chapter 8: Review Questions
- Chapter 8: Programming Problems
- Chapter 8: Programming Problems
- 9: Structured Data Types
- Introduction: Structured Data Types
- 9.1: Introduction
- 9.1: Introduction
- 9.2: Structures
- 9.2: Structures
- 9.2.1: Using the new Operator to Create Structure Instances
- 9.2.2: Using var to Declare Structure Objects
- 9.2.3: Accessing a Structure’s Fields
- 9.2.4: Assigning One Structure Object to Another
- 9.2.5: Passing Structure Objects to Methods
- 9.2.6: Returning a Structure Object from a Method
- 9.2.7: Comparing Structure Objects
- 9.2.8: Arrays of Structure Objects
- 9.2.9: Storing Structure Objects in a List
- 9.3: The DateTime and TimeSpan Structures
- 9.3: The DateTime and TimeSpan Structures
- 9.3.1: Displaying a DateTime Object
- 9.3.2: Getting the Current Date and Time from the System
- 9.3.3: Converting Strings to DateTime Structures
- 9.3.4:The DateTimePicker Control
- 9.3.5: Comparing DateTime Objects
- 9.3.6: The TimeSpan Structure
- 9.3.7: Performing Math with DateTime and TimeSpan Objects
- 9.4: Enumerated Types
- 9.4: Enumerated Types
- 9.4.1: Converting an Enumerator or enum Variable to a String
- 9.4.2: Getting an Enumerator’s or enum Variable’s Integer Value
- 9.4.3: Specifying Integer Values for Enumerators
- 9.4.4: Comparing Enumerators and enum Variables
- 9.4.5: Using an enum Variable to Step through an Array’s Elements
- 9.5: Dictionaries
- 9.5: Dictionaries
- 9.5.1: The Dictionary Class
- 9.5.2: Initializing a Dictionary
- 9.5.3: Adding Elements to an Existing Dictionary
- 9.5.4: Adding Elements with the Add Method
- 9.5.5: Retrieving Values from a Dictionary
- 9.5.6: Removing Elements
- 9.5.7: Iterating over a Dictionary with the foreach Loop
- 9.5.8: The ContainsKey, ContainsValue, and Contains Methods
- 9.5.9: Retrieving a Value with the TryGetValue Method
- 9.5.10: The Count Property and the ElementAt Method
- 9.5.11: The Clear Method
- 9.6: Tuples
- 9.6: Tuples
- 9.6.1: Declaring a Tuple Variable
- 9.6.2: Returning a Tuple from a Method
- 9.6.3: Named Fields
- 9.6.4: Deconstructing a Tuple
- 9.6.5: Tuple Assignment
- 9.6.6: Changing the Value of a Field
- 9.6.7: Comparing Tuples for Equality and Inequality
- 9.6.8: Inferred Field Names
- Chapter 9: Key Terms
- Chapter 9: Key Terms
- Chapter 9: Review Questions
- Chapter 9: Review Questions
- Chapter 9: Programming Problems
- Chapter 9: Programming Problems
- 10: Introduction to Classes
- Introduction: Introduction to Classes
- 10.1: Introduction to Classes
- 10.1: Introduction to Classes
- 10.1.1: Creating a Class
- 10.1.2: Creating an Object
- 10.1.3: Using var to Declare a Class Reference Variable
- 10.1.4: Where to Write Class Declarations
- 10.1.5: Scope of Fields
- 10.1.6: Shadowing
- 10.1.7: Initializing Fields at Declaration
- 10.1.8: Uninitialized Fields
- 10.2: Passing an Object to a Method
- 10.2: Passing an Object to a Method
- 10.3: Properties
- 10.3: Properties
- 10.3.1: Properties versus Public Fields
- 10.3.2: Passing Properties as Arguments
- 10.3.3: Referring to a Property inside the Class
- 10.3.4: Read-Only Properties
- 10.3.5: Private set Accessors
- 10.3.6: Avoiding Stale Data
- 10.4: Auto-Properties
- 10.4: Auto-Properties
- 10.4.1: Read-Only Auto-Properties
- 10.4.2: Using Private set Accessors with Auto-Properties
- 10.5: Parameterized Constructors and Method Overloading
- 10.5: Parameterized Constructors and Method Overloading
- 10.5.1: Overloaded Methods
- 10.5.2: Overloaded Constructors
- 10.5.3: Default Constructors
- 10.6: Storing Class Type Objects in Arrays and Lists
- 10.6: Storing Class Type Objects in Arrays and Lists
- 10.6.1: Arrays Hold References to Class Type Objects
- 10.6.2: Lists of Class Type Objects
- 10.7: Finding the Classes and Their Responsibilities in a Problem
- 10.7: Finding the Classes and Their Responsibilities in a Problem
- 10.7.1: Writing a Description of the Problem Domain
- 10.7.2: Identify All of the Nouns
- 10.7.3: Refining the List of Nouns
- 10.7.4: Identifying a Class’s Responsibilities
- 10.7.5: This Is Only the Beginning
- 10.8: Application of Classes: Creating Multiple Forms in a Project
- 10.8: Application of Classes: Creating Multiple Forms in a Project
- 10.8.1: Renaming the Form1 Form
- 10.8.2: Adding a New Form to a Project
- 10.8.3: Switching between Forms and Form Code
- 10.8.4: Removing a Form
- 10.8.5: Displaying a Form
- 10.8.6: Modal and Modeless Forms
- 10.8.7: Accessing Controls on a Different Form
- 10.9: Static Class Members
- 10.9: Static Class Members
- 10.9.1: Static Members
- 10.9.2: Static Fields
- 10.9.3: Static Properties
- 10.9.4: Static Methods
- 10.9.5: Static Classes
- Chapter 10: Key Terms
- Chapter 10: Key Terms
- Chapter 10: Review Questions
- Chapter 10: Review Questions
- Chapter 10: Programming Problems
- Chapter 10: Programming Problems
- 11: More about Classes
- Introduction: More about Classes
- 11.1: Returning Objects from Methods
- 11.1: Returning Objects from Methods
- 11.2: Writing a ToString Method
- 11.2: Writing a ToString Method
- 11.2.1: Implicitly Calling the ToString Method
- 11.3: Working with null
- 11.3: Working with null
- 11.3.1: Garbage Collection
- 11.3.2: Watch for null Strings as Fields or Properties
- 11.3.3: Nullable Value Types
- 11.4: The this Reference Variable
- 11.4: The this Reference Variable
- 11.4.1: Using this to Overcome Shadowing
- 11.4.2: Using this to Call an Overloaded Constructor from Another Constructor
- 11.5: Copying Objects
- 11.5: Copying Objects
- 11.5.1: Copy Constructors
- 11.6: Object Initializer Syntax and Init-Only Properties
- 11.6: Object Initializer Syntax and Init-Only Properties
- 11.6.1: Init-Only Properties
- 11.6.2: Using init with Fully Defined Properties
- 11.7: Mutable and Immutable Classes
- 11.7: Mutable and Immutable Classes
- 11.7.1: Immutable Classes with Mutable Objects as Fields or Properties
- 11.8: Aggregation and Composition
- 11.8: Aggregation and Composition
- 11.8.1: Composition: A Strong Form of Aggregation
- 11.9: Passing and Returning Anonymous Objects
- 11.9: Passing and Returning Anonymous Objects
- 11.9.1: Passing an Anonymous Object as an Argument to a Method
- 11.9.2: Returning an Anonymous Object from a Method
- 11.10: Class Collaboration
- 11.10: Class Collaboration
- Chapter 11: Key Terms
- Chapter 11: Key Terms
- Chapter 11: Review Questions
- Chapter 11: Review Questions
- Chapter 11: Programming Problems
- Chapter 11: Programming Problems
- 12: Inheritance, Polymorphism, and Interfaces
- Introduction: Inheritance, Polymorphism, and Interfaces
- 12.1: Inheritance
- 12.1: Inheritance
- 12.1.1: Inheritance and the “Is a” Relationship
- 12.1.2: Base Class and Derived Class Constructors
- 12.1.3: Summary of Constructor Issues in Inheritance
- 12.1.4: Protected Members
- 12.1.5: Restricting Inheritance with the sealed Keyword
- 12.2: Polymorphism
- 12.2: Polymorphism
- 12.2.1: Overriding Properties
- 12.2.2: Base Class Reference Variables Know about Base Class Members Only
- 12.2.3: The “Is a” Relationship Does Not Work in Reverse
- 12.2.4: Passing Objects to Base Class Parameters
- 12.2.5: Preventing Method Overriding with the sealed Keyword
- 12.3: Abstract Classes
- 12.3: Abstract Classes
- 12.4: Extension Methods
- 12.4: Extension Methods
- 12.5: Interfaces
- 12.5: Interfaces
- 12.5.1: Properties in Interfaces
- 12.5.2: Read-Only Interface Properties
- 12.5.3: An Interface Is a Contract
- 12.5.4: Creating an Interface in Visual Studio
- 12.5.5: Implementing Multiple Interfaces
- 12.5.6: Declaring a Derived Class That Implements an Interface
- 12.5.7: Polymorphism and Interfaces
- 12.5.8: Arrays and Lists of Interface References
- 12.5.9: Restrictions of Interfaces
- Chapter 12: Key Terms
- Chapter 12: Key Terms
- Chapter 12: Review Questions
- Chapter 12: Review Questions
- Chapter 12: Programming Problems
- Chapter 12: Programming Problems
- 13: Databases
- Introduction: Databases
- 13.1: Introduction to Database Management Systems
- 13.1: Introduction to Database Management Systems
- 13.1.1: SQL Server Express Edition
- 13.2: Tables, Rows, and Columns
- 13.2: Tables, Rows, and Columns
- 13.2.1: Column Data Types
- 13.2.2: Primary Keys
- 13.2.3: Identity Columns
- 13.2.4: Allowing Null Values
- 13.3: Creating a Database in Visual Studio
- 13.3: Creating a Database in Visual Studio
- 13.3.1: The Database File’s Location
- 13.4: The DataGridView Control
- 13.4: The DataGridView Control
- 13.4.1: Auto-Generated Code
- 13.5: Connecting to an Existing Database and Using Details View Controls
- 13.5: Connecting to an Existing Database and Using Details View Controls
- 13.5.1: Copies of the Database at Run Time
- 13.6: More about Data-Bound Controls
- 13.6: More about Data-Bound Controls
- 13.6.1: Customizing the Details View
- 13.6.2: Binding Columns to ListBox Controls
- 13.6.3: Having Data-Bound Controls on Multiple Forms
- 13.7: Selecting Data with the SQL Select Statement
- 13.7: Selecting Data with the SQL Select Statement
- 13.7.1: Specifying a Search Criteria with the Where Clause
- 13.7.2: Using the Like Operator
- 13.7.3: Using And and Or
- 13.7.4: Sorting the Results of a Select Query
- 13.7.5: Table Adapter Queries
- 13.7.6: Adding New Table Adapter Queries
- 13.7.7: SQL Math Functions
- 13.7.8: Query Parameters
- Chapter 13: Key Terms
- Chapter 13: Key Terms
- Chapter 13: Review Questions
- Chapter 13: Review Questions
- Chapter 13: Programming Problems
- Chapter 13: Programming Problems
- 14: Delegates, Anonymous Methods, and Lambda Expressions
- Introduction: Delegates, Anonymous Methods, and Lambda Expressions
- 14.1: Delegates
- 14.1: Delegates
- 14.1.1: Reassigning a Delegate
- 14.1.2: Passing a Delegate to a Method
- 14.1.3: Multicast Delegates
- 14.2: Anonymous Methods
- 14.2: Anonymous Methods
- 14.3: Lambda Expressions
- 14.3: Lambda Expressions
- 14.3.1: Lambda Expressions with Multiple Parameters
- 14.3.2: Lambda Expressions with No Parameters
- 14.3.3: Lambda Expressions That Do Not Return a Value
- 14.3.4: Explicitly Declaring a Parameter’s Data Type
- 14.3.5: Using Multiple Statements in the Body of a Lambda Expression
- 14.3.6: Accessing Outer Variables within a Lambda Expression
- 14.3.7: Passing Lambda Expressions as Arguments
- 14.3.8: Using Lambda Expressions to Define Class Methods
- 14.4: Built-In Delegates: Action, Func, and Predicate
- 14.4: Built-In Delegates: Action, Func, and Predicate
- 14.4.1: Action Delegates
- 14.4.2: Func Delegates
- 14.4.3: Predicate Delegates
- 14.4.4: List Methods That Work with Delegates
- Chapter 14: Key Terms
- Chapter 14: Key Terms
- Chapter 14: Review Questions
- Chapter 14: Review Questions
- Chapter 14: Programming Problems
- Chapter 14: Programming Problems
- 15: Language-Integrated Query (LINQ)
- Introduction: Language-Integrated Query (LINQ)
- 15.1: Introduction to LINQ
- 15.1: Introduction to LINQ
- 15.1.1: The IEnumberable< T > Interface
- 15.1.2: More about the select Operator
- 15.1.3: Using Multiple where Clauses
- 15.1.4: The orderby Clause
- 15.2: LINQ Method Syntax
- 15.2: LINQ Method Syntax
- 15.2.1: The Where Method
- 15.2.2: The OrderBy and OrderByDescending Methods
- 15.2.3: The Select Method
- 15.3: More LINQ Extension Methods
- 15.3: More LINQ Extension Methods
- 15.3.1: Quantifier Methods
- 15.3.2: Aggregation Methods
- 15.3.3: Element Methods
- 15.3.4: Generation Methods
- 15.3.5: Set Methods
- 15.3.6: Partitioning Methods
- 15.3.7: Miscellaneous Methods
- 15.4: Using LINQ to Query a Database
- 15.4: Using LINQ to Query a Database
- 15.4.1: Data Context Objects
- 15.4.2: Table Objects
- 15.4.3: Entity Objects
- 15.4.4: Installing LINQ to SQL
- 15.4.5: Setting Up LINQ to SQL to Work with a Database
- 15.4.6: LINQ to SQL Naming Conventions
- 15.4.7: Working with the Data Context Object
- 15.4.8: Writing LINQ to SQL Queries
- 15.4.9: Using LINQ Queries with Data-Bound Controls
- 15.4.10: Updating, Inserting, and Deleting Rows with LINQ
- Chapter 15: Key Terms
- Chapter 15: Key Terms
- Chapter 15: Review Questions
- Chapter 15: Review Questions
- Chapter 15: Programming Problems
- Chapter 15: Programming Problems
- Appendix A: C# Primitive Data Types
- Appendix A: C# Primitive Data Types
- Appendix B: Additional User Interface Controls
- Appendix B: Additional User Interface Controls
- ToolTips
- Combo Boxes
- Scroll Bars
- Using a TabControl to Organize a Form
- The WebBrowser Control (.NET Framework Projects)
- The ErrorProvider Component
- Using the SelectionStart and SelectionLength Properties to Select Text in a TextBox
- Creating a Menu System
- Appendix C: ASCII/Unicode Characters
- Appendix C: ASCII/Unicode Characters
- Appendix D: Answers to Checkpoint Questions
- Appendix D: Answers to Checkpoint Questions
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12
- Chapter 13
- Chapter 14
- Chapter 15
- Appendix E: Installing LINQ to SQL Classes in Visual Studio
- Appendix E: Installing LINQ to SQL Classes in Visual Studio
- Footnotes
- Glossary




