Introduction

Overview of C# 4.0 How-To

This book is very different from a typical “bible” approach to a topic. By structuring the book as a “how-to,” it presents the material by scenario in steps that are easily followed. Throughout, I have tried to keep the explanatory text to the minimum necessary and keep the focus on the code itself. Often, you will find comments embedded in the code to explain non-obvious bits.

This book is not strictly a language/library book. Besides covering the language features themselves, it dives into practical examples of application patterns, useful algorithms, and handy tips that are applicable in many situations.

Developers, both beginner and advanced, will find hundreds of useful topics in this book. Whether it’s a section on lesser-known C# operators, how to sort strings that contain numbers in them, or how to implement Undo, this book contains recipes that are useful in a wide variety of situations, regardless of skill level.

In short, this is the book I wish I had on my desk when I was first learning programming and C# as well as now, whenever I need a quick reference or reminder about how to do something.

How-To Benefit from This Book

We designed this book to be easy to read from cover to cover. The goal is to gain a full understanding of C# 4.0. The subject matter is divided into four parts with easy-to-navigate and easy-to-use chapters.

Part I, “C# Fundamentals,” covers the common C# functionality that you will use in every type of programming. While it may seem basic, there are a lot of tips to help you get the most of these fundamental topics.

Chapter 1, “Type Fundamentals

Chapter 2, “Creating Versatile Types

Chapter 3, “General Coding

Chapter 4, “Exceptions

Chapter 5, “Numbers

Chapter 6, “Enumerations

Chapter 7, “Strings

Chapter 8, “Regular Expressions

Chapter 9, “Generics

Part II, “Handling Data,” discusses how to store and manipulate data, including Internet-based data.

Chapter 10, “Collections

Chapter 11, “Files and Serialization

Chapter 12, “Networking and the Web

Chapter 13, “Databases

Chapter 14, “XML

Part IIIUser Interaction,” covers the most popular user interface paradigms in .Net, whether you work on the desktop, the Web, or both.

Chapter 15, “Delegates, Events, and Anonymous Methods

Chapter 16, “Windows Forms

Chapter 17, “Graphics with Windows Forms and GDI+

Chapter 18, “WPF

Chapter 19, “ASP.NET

Chapter 20, “Silverlight

Part IV, “Advanced C#,” has the advanced stuff to really take your applications to the next level in terms of performance, design patterns, useful algorithms, and more.

Chapter 21, “LINQ

Chapter 22, “Memory Management

Chapter 23, “Threads, Asynchronous, and Parallel Programming

Chapter 24, “Reflection and Creating Plugins

Chapter 25, “Application Patterns and Tips

Chapter 26, “Interacting with the OS and Hardware

Chapter 27, “Fun Stuff and Loose Ends

Appendix A, “Essential Tools

All of the code was developed using prerelease versions of Visual Studio 2010, but you can use earlier versions in many cases, especially for code that does not require .NET 4. If you do not have Visual Studio, you can download the Express edition from www.microsoft.com/express/default.aspx. This version will enable you to build nearly all the code samples in this book.

You can access the code samples used in this book by registering on the book’s website at informit.com/register. Go to this URL, sign in, and enter the ISBN to register (free site registration required). After you register, look on your Account page, under Registered Products, for a link to Access Bonus Content.

How-To Continue Expanding Your Knowledge

No book can completely cover C#, the .NET Framework, or probably even hope to cover a small topic within that world. And if there were, you probably couldn’t lift it, let alone read it in your lifetime.

Once you’ve mastered the essentials, there are plenty of resources to get your questions answered and dive deeply into .NET.

Thankfully, the MSDN documentation for .NET (located at http://msdn.microsoft.com/en-us/library/aa139615.aspx) is top-notch. Most topics have code samples and an explanation use. An added bonus is the ability at the bottom of every topic for anyone to add useful content. There are many good tips found here from other .NET developers.

The .NET Development forums (http://social.msdn.microsoft.com/Forums/en-US/category/netdevelopment) are an excellent place to get your questions answered by the experts, who, in many cases, were involved in the development and testing of .NET.

I have also found StackOverflow.com a good place to get questions answered.

The best advice I can give on how to continue expanding your knowledge is to just write software. Keep at it, think of new projects, use new technologies, go beyond your abilities. This and other books are very useful, to a point. After that, you just need to dive in and start coding, using the book as a faithful reference when you don’t know how to approach a topic.

Happy coding!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset