Synopses & Reviews
Get the hands-on, step-by-step guide to learning the latest enhancements in Microsoft Visual C# 2008. Visual C#, one of the tools in Microsoft Visual Studio® 2008, is a modern programming language designed to deliver a productive environment for creating business frameworks and reusable object-oriented components. Whether youre a beginning programmer or new to the Visual C# programming language, youll learn how to use the fundamental features of Visual Studio 2008 and gain a basic understanding of the latest enhancement of the Visual C# language. Youll work at your own pace through hands-on, learn-by-doing exercises, get started creating components and working Windows® applications, and build your knowledge as you start creating your first Visual C#-based applications. Youll also explore how to create data management and Web-based applications. In each chapter, work through learn-by-doing exercises that demonstrate how, when, and why to use the many features of the Visual C# rapid application development environment. Includes a companion CD with code samples, data sets, and a fully searchable eBook.
A Note Regarding the CD or DVD
The print version of this book ships with a CD or DVD. For those customers purchasing one of the digital formats in which this book is available, we are pleased to offer the CD/DVD content as a free download via OReilly Medias Digital Distribution services. To download this content, please visit OReillys web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to [email protected].
Synopsis
Get the hands-on, step-by-step guide to learning the latest enhancements in Microsoft Visual C# 2008. Visual C#, one of the tools in Microsoft Visual Studio 2008, is a modern programming language designed to deliver a productive environment for creating business frameworks and reusable object-oriented components. Whether you’re a beginning programmer or new to the Visual C# programming language, you’ll learn how to use the fundamental features of Visual Studio 2008 and gain a basic understanding of the latest enhancement of the Visual C# language. You’ll work at your own pace through hands-on, learn-by-doing exercises, get started creating components and working Windows applications, and build your knowledge as you start creating your first Visual C#–based applications. You’ll also explore how to create data management and Web-based applications. In each chapter, work through learn-by-doing exercises that demonstrate how, when, and why to use the many features of the Visual C# rapid application development environment. Includes a companion CD with code samples, data sets, and a fully searchable eBook.
For customers who purchase an ebook version of this title, instructions for downloading the CD files can be found in the ebook.
Synopsis
Get the hands-on, step-by-step guide to learning the latest enhancements in Microsoft Visual C# 2008. Visual C#, one of the tools in Microsoft Visual Studio(R) 2008, is a modern programming language designed to deliver a productive environment for creating business frameworks and reusable object-oriented components. Whether you're a beginning programmer or new to the Visual C# programming language, you'll learn how to use the fundamental features of Visual Studio 2008 and gain a basic understanding of the latest enhancement of the Visual C# language. You'll work at your own pace through hands-on, learn-by-doing exercises, get started creating components and working Windows(R) applications, and build your knowledge as you start creating your first Visual C#-based applications. You'll also explore how to create data management and Web-based applications. In each chapter, work through learn-by-doing exercises that demonstrate how, when, and why to use the many features of the Visual C# rapid application development environment. Includes a companion CD with code samples, data sets, and a fully searchable eBook.
A Note Regarding the CD or DVD
The print version of this book ships with a CD or DVD. For those customers purchasing one of the digital formats in which this book is available, we are pleased to offer the CD/DVD content as a free download via OReilly Medias Digital Distribution services. To download this content, please visit OReillys web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to [email protected].
About the Author
John Sharp is a principal technologist at Content Master, part of CM Group Ltd, a technical authoring and consulting company. An expert on developing applications with the Microsoft .NET Framework and interoperability issues, John has produced numerous tutorials, white papers, and presentations on distributed systems, Web services, and the C# language. He is the author of several popular books, including Microsoft Windows Communication Foundation Step By Step and Microsoft Visual C# Step By Step.
Table of Contents
Acknowledgments; Introduction; Who This Book Is For; Finding Your Best Starting Point in This Book; Conventions and Features in This Book; System Requirements; Code Samples; Uninstalling the Code Samples; Support for This Book; Part I: Introducing Microsoft Visual C# and Microsoft Visual Studio 2008; Chapter 1: Welcome to C#; 1.1 Beginning Programming with the Visual Studio 2008 Environment; 1.2 Writing Your First Program; 1.3 Using Namespaces; 1.4 Creating a Graphical Application; 1.5 Quick Reference; Chapter 2: Working with Variables, Operators, and Expressions; 2.1 Understanding Statements; 2.2 Using Identifiers; 2.3 Identifying Keywords; 2.4 Using Variables; 2.5 Working with Primitive Data Types; 2.6 Using Arithmetic Operators; 2.7 Incrementing and Decrementing Variables; 2.8 Declaring Implicitly Typed Local Variables; 2.9 Quick Reference; Chapter 3: Writing Methods and Applying Scope; 3.1 Declaring Methods; 3.2 Applying Scope; 3.3 Writing Methods; 3.4 Quick Reference; Chapter 4: Using Decision Statements; 4.1 Declaring Boolean Variables; 4.2 Using Boolean Operators; 4.3 Using if Statements to Make Decisions; 4.4 Using switch Statements; 4.5 Quick Reference; Chapter 5: Using Compound Assignment and Iteration Statements; 5.1 Using Compound Assignment Operators; 5.2 Writing while Statements; 5.3 Writing for Statements; 5.4 Writing do Statements; 5.5 Quick Reference; Chapter 6: Managing Errors and Exceptions; 6.1 Coping with Errors; 6.2 Trying Code and Catching Exceptions; 6.3 Using Checked and Unchecked Integer Arithmetic; 6.4 Throwing Exceptions; 6.5 Using a finally Block; 6.6 Quick Reference; Part II: Understanding the C# Language; Chapter 7: Creating and Managing Classes and Objects; 7.1 Understanding Classification; 7.2 The Purpose of Encapsulation; 7.3 Defining and Using a Class; 7.4 Controlling Accessibility; 7.5 Working with Constructors; 7.6 Understanding static Methods and Data; 7.7 Quick Reference; Chapter 8: Understanding Values and References; 8.1 Copying Value Type Variables and Classes; 8.2 Understanding Null Values and Nullable Types; 8.3 Using ref and out Parameters; 8.4 How Computer Memory Is Organized; 8.5 The System.Object Class; 8.6 Boxing; 8.7 Unboxing; 8.8 Casting Data Safely; 8.9 Quick Reference; Chapter 9: Creating Value Types with Enumerations and Structures; 9.1 Working with Enumerations; 9.2 Working with Structures; 9.3 Quick Reference; Chapter 10: Using Arrays and Collections; 10.1 What Is an Array?; 10.2 Initializing Array Variables; 10.3 What Are Collection Classes?; 10.4 The SortedList Collection Class; 10.5 Quick Reference; Chapter 11: Understanding Parameter Arrays; 11.1 Using Array Arguments; 11.2 Quick Reference; Chapter 12: Working with Inheritance; 12.1 What Is Inheritance?; 12.2 Using Inheritance; 12.3 Understanding Extension Methods; 12.4 Quick Reference; Chapter 13: Creating Interfaces and Defining Abstract Classes; 13.1 Understanding Interfaces; 13.2 Interface Restrictions; 13.3 Abstract Classes; 13.4 Sealed Classes; 13.5 Implementing an Extensible Framework; 13.6 Summarizing Keyword Combinations; 13.7 Quick Reference; Chapter 14: Using Garbage Collection and Resource Management; 14.1 The Life and Times of an Object; 14.2 Resource Management; 14.3 Making Code Exception-Safe; 14.4 Quick Reference; Part III: Creating Components; Chapter 15: Implementing Properties to Access Fields; 15.1 Implementing Encapsulation by Using Methods; 15.2 What Are Properties?; 15.3 Understanding the Property Restrictions; 15.4 Declaring Interface Properties; 15.5 Generating Automatic Properties; 15.6 Initializing Objects by Using Properties; 15.7 Quick Reference; Chapter 16: Using Indexers; 16.1 What Is an Indexer?; 16.2 Indexers in Interfaces; 16.3 Using Indexers in a Windows Application; 16.4 Quick Reference; Chapter 17: Interrupting Program Flow and Handling Events; 17.1 Declaring and Using Delegates; 17.2 Lambda Expressions and Delegates; 17.3 Enabling Notifications with Events; 17.4 Unsubscribing from an Event; 17.5 Understanding WPF User Interface Events; 17.6 Quick Reference; Chapter 18: Introducing Generics; 18.1 The Problem with objects; 18.2 The Generics Solution; 18.3 Creating a Generic Class; 18.4 Creating a Generic Method; 18.5 Quick reference; Chapter 19: Enumerating Collections; 19.1 Enumerating the Elements in a Collection; 19.2 Implementing an Enumerator by Using an Iterator; 19.3 Quick Reference; Chapter 20: Querying In-Memory Data by Using Query Expressions; 20.1 What Is Language Integrated Query (LINQ)?; 20.2 Usinnnnnng LINQ in a C# Application; 20.3 Quick Reference; Chapter 21: Operator Overloading; 21.1 Understanding Operators; 21.2 Understanding Compound Assignment; 21.3 Declaring Increment and Decrement Operators; 21.4 Defining Operator Pairs; 21.5 Implementing an Operator; 21.6 Understanding Conversion Operators; 21.7 Quick Reference; Part IV: Working with Windows Applications; Chapter 22: Introducing Windows Presentation Foundation; 22.1 Creating a WPF Application; 22.2 Adding Controls to the Form; 22.3 Handling Events in a WPF Form; 22.4 Quick Reference; Chapter 23: Working with Menus and Dialog Boxes; 23.1 Menu Guidelines and Style; 23.2 Menus and Menu Events; 23.3 Shortcut Menus; 23.4 Windows Common Dialog Boxes; 23.5 Quick Reference; Chapter 24: Performing Validation; 24.1 Validating Data; 24.2 An ExampleCustomer Information Maintenance; 24.3 Quick Reference; Part V: Managing Data; Chapter 25: Querying Information in a Database; 25.1 Querying a Database by Using ADO.NET; 25.2 Querying a Database by Using DLINQ; 25.3 Quick Reference; Chapter 26: Displaying and Editing Data by Using Data Binding; 26.1 Using Data Binding with DLINQ; 26.2 Using DLINQ to Modify Data; 26.3 Quick Reference; Part VI: Building Web Applications; Chapter 27: Introducing ASP.NET; 27.1 Understanding the Internet as an Infrastructure; 27.2 Creating Web Applications with ASP.NET; 27.3 Quick Reference; Chapter 28: Understanding Web Forms Validation Controls; 28.1 Comparing Server and Client Validations; 28.2 Quick Reference; Chapter 29: Protecting a Web Site and Accessing Data with Web Forms; 29.1 Managing Security; 29.2 Querying and Displaying Data; 29.3 Editing Data; 29.4 Navigating Between Forms; 29.5 Quick Reference; Chapter 30: Creating and Using a Web Service; 30.1 What Is a Web Service?; 30.2 Building a Web Service; 30.3 Web Services, Clients, and Proxies; 30.4 Quick Reference;