Microsoft Visual C# Step by Step, 10th Edition

Book description

Your hands-on guide to Microsoft Visual C# fundamentals with Visual Studio.

Expand your expertiseand teach yourself the fundamentals of programming with the latest version of Visual C# with Visual Studio. If you are an experienced software developer, you'll get all the guidance, exercises, and code you need to start building responsive, scalable, cloud-connected applications that can run almost anywhere.

Discover how to:

  • Quickly start creating Visual C# code and projects with Visual Studio

  • Work with variables, operators, expressions, methods, and program flow

  • Build more robust apps with error, exception, and resource management

  • Spot problems fast with the Visual Studio debugger

  • Make the most of improvements to C# methods, parameters, and switch statements

  • Master the C# object model, and create your own functional data structures

  • Leverage advanced properties, indexers, generics, and collection classes

  • Create Windows 10 apps that share data, collaborate, and use cloud services

  • Integrate Cortana to voice-enable your applications

  • Perform complex queries over object collections with LINQ

  • Improve application throughput and response time with asynchronous methods

  • Use delegates and decoupling to construct highly extensible systems

  • Customize C# operator behavior over your own classes and structures

  • Streamline development with app templates

  • Implement the powerful Model-View-ViewModel (MVVM) pattern

  • Develop cloud-connected applications that seamlessly follow users across devices

  • Build UWP applications that retrieve complex data via REST and present it intuitively

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Pearson’s Commitment to Diversity, Equity, and Inclusion
  5. Contents at a Glance
  6. Contents
  7. Acknowledgments
  8. About the author
  9. Introduction
    1. Who should read this book
    2. Who should not read this book
    3. Finding your best starting point in this book
    4. Conventions and features in this book
    5. System requirements
    6. Code samples
    7. Errata and book support
    8. Stay in touch
  10. Part I: Introducing Microsoft Visual C# and Microsoft Visual Studio 2022
    1. Chapter 1. Welcome to C#
      1. Writing your first C# program
      2. Beginning programming with the Visual Studio 2022 environment
      3. Writing your first program using Visual Studio 2022
      4. Using namespaces
      5. Namespaces and assemblies
      6. Commenting code
      7. Creating a graphical application
      8. Summary
      9. Quick Reference
    2. Chapter 2. Working with variables, operators, and expressions
      1. Understanding statements
      2. Using identifiers
      3. Identifying keywords
      4. Using variables
      5. Working with primitive data types
      6. Using arithmetic operators
      7. Incrementing and decrementing variables
      8. Declaring implicitly typed local variables
      9. Summary
      10. Quick Reference
    3. Chapter 3. Writing methods and applying scope
      1. Creating methods
      2. Calling methods
      3. Applying scope
      4. Using the Visual Studio Debugger to step through methods
      5. Using optional parameters and named arguments
      6. Summary
      7. Quick reference
    4. Chapter 4. Using decision statements
      1. Declaring Boolean variables
      2. Using Boolean operators
      3. Using if statements to make decisions
      4. Using switch statements
      5. Using switch expressions with pattern matching
      6. Summary
      7. Quick reference
    5. Chapter 5. Using compound assignment and iteration statements
      1. Using compound assignment operators
      2. Writing while statements
      3. Writing for statements
      4. Writing do statements
      5. Summary
      6. Quick reference
    6. Chapter 6. Managing errors and exceptions
      1. Trying code and catching exceptions
      2. Using checked and unchecked integer arithmetic
      3. Throwing exceptions
      4. Using a finally block
      5. Summary
      6. Quick reference
  11. Part II: Understanding the C# object model
    1. Chapter 7. Creating and managing classes and objects
      1. Understanding classification
      2. The purpose of encapsulation
      3. Defining and using a class
      4. Controlling accessibility
      5. Working with constructors
      6. Understanding static methods and data
      7. Anonymous classes
      8. Summary
      9. Quick reference
    2. Chapter 8. Understanding values and references
      1. Copying value type variables and classes
      2. Understanding null values and nullable types
      3. Using ref and out parameters
      4. How computer memory is organized
      5. Casting data safely
      6. Summary
      7. Quick reference
    3. Chapter 9. Creating value types with enumerations and structures
      1. Working with enumerations
      2. Working with structures
      3. Summary
      4. Quick reference
    4. Chapter 10. Using arrays
      1. Declaring array variables
      2. Creating an array instance
      3. Populating and using an array
      4. Copying arrays
      5. Using multidimensional arrays
      6. Accessing arrays that contain value types
      7. Summary
      8. Quick reference
    5. Chapter 11. Understanding parameter arrays
      1. Overloading: a recap
      2. Using array arguments
      3. Comparing parameter arrays and optional parameters
      4. Summary
      5. Quick reference
    6. Chapter 12. Working with inheritance
      1. What is inheritance?
      2. Using inheritance
      3. Creating extension methods
      4. Summary
      5. Quick reference
    7. Chapter 13. Creating interfaces and defining abstract classes
      1. Understanding interfaces
      2. Abstract classes
      3. Sealed classes
      4. Summary
      5. Quick reference
    8. Chapter 14. Using garbage collection and resource management
      1. The life and times of an object
      2. Resource management
      3. Implementing exception-safe disposal
      4. Handling asynchronous disposal
      5. Summary
      6. Quick reference
  12. Part III: Understanding the C# object model
    1. Chapter 15. Implementing properties to access fields
      1. Implementing encapsulation by using methods
      2. What are properties?
      3. Understanding property restrictions
      4. Declaring interface properties
      5. Generating automatic properties
      6. Initializing objects by using properties
      7. Using records with properties to implement lightweight structures
      8. Summary
      9. Quick reference
    2. Chapter 16. Handling binary data and using indexers
      1. What is an indexer?
      2. Understanding indexer accessors
      3. Comparing indexers and arrays
      4. Indexers in interfaces
      5. Using indexers in a Windows application
      6. Summary
      7. Quick reference
    3. Chapter 17. Introducing generics
      1. The problem: Issues with the object type
      2. The generics solution
      3. Creating a generic class
      4. Creating a generic method
      5. Variance and generic interfaces
      6. Summary
      7. Quick reference
    4. Chapter 18. Using collections
      1. What are collection classes?
      2. Using collection initializers
      3. Find methods, predicates, and lambda expressions
      4. Comparing arrays and collections
      5. Summary
      6. Quick reference
    5. Chapter 19. Enumerating collections
      1. Enumerating the elements in a collection
      2. Implementing an enumerator by using an iterator
      3. Summary
      4. Quick reference
    6. Chapter 20. Decoupling application logic and handling events
      1. Understanding delegates
      2. Examples of delegates in the .NET class library
      3. Lambda expressions and delegates
      4. Enabling notifications by using events
      5. Understanding user-interface events
      6. Using events
      7. Summary
      8. Quick reference
    7. Chapter 21. Querying in-memory data by using query expressions
      1. What is LINQ?
      2. Using LINQ in a C# application
      3. LINQ and deferred evaluation
      4. Summary
      5. Quick reference
    8. Chapter 22. Operator overloading
      1. Understanding operators
      2. Declaring increment and decrement operators
      3. Comparing operators in structures and classes
      4. Defining operator pairs
      5. Implementing operators
      6. Overriding the equality operators
      7. Understanding conversion operators
      8. Summary
      9. Quick reference
  13. Part IV: Building Universal Windows Platform applications with C#
    1. Chapter 23. Improving throughput by using tasks
      1. Why perform multitasking by using parallel processing?
      2. The rise of the multicore processor
      3. Implementing multitasking by using Microsoft .NET
      4. Canceling tasks and handling exceptions
      5. Summary
      6. Quick reference
    2. Chapter 24. Improving response time by performing asynchronous operations
      1. Implementing asynchronous methods
      2. Using PLINQ to parallelize declarative data access
      3. Synchronizing concurrent access to data
      4. Summary
      5. Quick reference
    3. Chapter 25. Implementing the user interface for a Universal Windows Platform app
      1. Features of a Universal Windows Platform app
      2. Using the Blank App template to build a Universal Windows Platform app
      3. Implementing a scalable user interface
      4. Applying styles to a UI
      5. Summary
      6. Quick reference
    4. Chapter 26. Displaying and searching for data in a Universal Windows Platform app
      1. Implementing the Model-View-ViewModel pattern
      2. Displaying data by using data binding
      3. Creating a ViewModel
      4. Adding commands to a ViewModel
      5. Summary
      6. Quick reference
    5. Chapter 27. Accessing a remote database from a Universal Windows Platform app
      1. Retrieving data from a database
      2. Updating the UWP application to use the web service
      3. Searching for data in the Customers app
      4. Inserting, updating, and deleting data through a REST web service
      5. Summary
      6. Quick reference
  14. Index
  15. Code Snippets

Product information

  • Title: Microsoft Visual C# Step by Step, 10th Edition
  • Author(s): John Sharp
  • Release date: March 2022
  • Publisher(s): Microsoft Press
  • ISBN: 9780137619856