Programmer's Reference
Total Page:16
File Type:pdf, Size:1020Kb
spine=1.68" Wrox Programmer to ProgrammerTM Wrox Programmer to ProgrammerTM C# 2008 Lee Programmer’s Reference The 2008 version of C# comes with the .NET Framework and boasts many new features that make it even more intuitive and powerful than previous iterations. Wrox Programmer to Programmer TM Offering you a complete reference on the new 2008 release, this authoritative C# 2008 book is essential reading—no matter your level of experience. Professional You’ll learn the C# language fundamentals and application development using Visual Studio® C# as you gradually master the complex array of new language options and Extensibility Keyvan Nayyeri parameters that C# 2008 offers. Plus, you’ll discover how to find the right options Updates, source code, and Wrox technical support at www.wrox.com for best programming practices and results. Code examples help illustrate each concept, while chapters independent of one another allow you to jump to specific areas of interest. Valuable appendices cover the list of C# keywords, the .NET class libraries, and document generation using the Sandcastle utility. With this ideal resource and reference by your side, you’ll come to understand the features that make C# 2008 a more powerful programming language than ever before. What you will learn from this book ● The fundamentals of the C# language and object-oriented programming ● Different types of inheritance and how it enables code reuse ● How you can use generics to enhance efficiency and type-safety in your applications ● Ways to use LINQ queries for data retrieval ● Techniques for writing multithreaded applications using the Thread class in the .NET Framework ● Enhance Your Knowledge Methods for using the C# language to build Windows, Web and Windows Advance Your Career C# 2008 Mobile applications ● How to build Windows Communication Foundation services and understand the theories behind them ● How to build RIA applications using Silverlight™ 1.0 and 2 Who this book is for This book is for C# developers of all levels of experience who are looking for a comprehensive overview of the language. Wrox Programmer’s References are designed to give the experienced developer straight facts on a new technology, without hype or unnecessary explanations. They deliver hard information with plenty of practical examples to help you apply new tools to subtitle your development projects today. Programmer’s www.wrox.com Reference Programmer’s Reference Recommended Programming/Development ISBN: 978-0-470-28581-7 Computer Book Categories C# and the .NET 3.5 framework Wei-Meng Lee $44.99 USA $48.99 CAN Updates, source code, and Wrox technical support at www.wrox.com spine=1.68" Programmer to Programmer™ C# 2008 Programmer’s Reference Professional Visual Studio 2008 978-0-470-22988-0 Wrox Programmer to Programmer TM In these pages you’ll learn to harness every key feature of Visual Studio. The opening section will familiarize you with the IDE structure and layout, various options and settings, and other core aspects of Visual Studio Get more out of Professional Visual Studio® 2008. Then you will examine each of the nine major categories composing Extensibility the functions of Visual Studio 2008. Every chapter is cross-referenced, Keyvan Nayyeri Updates, source code, and Wrox technical support at www.wrox.com so you can achieve a complete understanding of each feature and how all the elements work together to produce an effective programming WROX.com environment. Professional Visual Studio Extensibility 978-0-470-23084-8 Whether you want to integrate optimized builds, enhanced programming tools, or other rapid application development features, this unique resource shows you how to develop customized addins using C#. Interact Chapters on Demand C# 2008 Programmer’s Reference Take an active role online by participating in Purchase individual book chapters in pdf 978-0-470-28581-7 our P2P forums format C# 2008 Programmers Reference provides a concise and thorough reference on all aspects of the language. Each chapter contains detailed code samples that provide a quick and easy way to understand the key Wrox Online Library Join the Community concepts covered. Professional C# 2008 Hundreds of our books are available online Sign up for our free monthly newsletter at 978-0-470-19137-8 through Books24x7.com newsletter.wrox.com Updated for .NET 3.5 and Visual Studio® 2008, this book is the ultimate Enhance Your Knowledge guide to C# 2008 and its environment. The team of superlative authors Advance Your Career explain why the C# language cannot be viewed in isolation, but rather, Wrox Blox Browse must be considered in parallel with the .NET Framework. Beginning Microsoft Visual C# 2008 Download short informational pieces and Ready for more Wrox? We have books and 978-0-470-19135-4 code to keep you up to date and out of e-books available on .NET, SQL Server, Java, Aimed at novice programmers who wish to learn programming with C# and trouble! XML, Visual Basic, C#/ C++, and much more! the .NET framework, this book starts with absolute programming basics, then moves into Web and Windows programming, data access (databases and XML), and more advanced technologies. Beginning C# 3.0: An Introduction to Object Oriented Programming 978-0-470-26129-3 This book is written for those readers with no prior programming experience who want a thorough, yet easy to understand, introduction to Contact Us. C# and Object Oriented Programming. We always like to get feedback from our readers. Have a book idea? Need community support? Let us know by e-mailing [email protected] C# 2008 Programmer’s Reference Introduction ............................................................................................... xxv Part I: C# Fundamentals Chapter 1: The .NET Framework ......................................................................3 Chapter 2: Getting Started with Visual Studio 2008 ......................................11 Chapter 3: C# Language Foundations ............................................................61 Chapter 4: Classes and Objects ..................................................................125 Chapter 5: Interfaces ..................................................................................171 Chapter 6: Inheritance ................................................................................183 Chapter 7: Delegates and Events ................................................................213 Chapter 8: Strings and Regular Expressions ................................................241 Chapter 9: Generics ....................................................................................265 Chapter 10: Threading ................................................................................293 Chapter 11: Files and Streams ....................................................................321 Chapter 12: Exception Handling ..................................................................377 Chapter 13: Arrays and Collections .............................................................397 Chapter 14: Language Integrated Query (LINQ) ...........................................425 Chapter 15: Assemblies and Versioning .......................................................467 Part II: Application Development Using C# Chapter 16: Developing Windows Applications ............................................503 Chapter 17: Developing ASP.NET Web Applications ......................................545 Chapter 18: Developing Windows Mobile Applications .................................573 Chapter 19: Developing Silverlight Applications ...........................................617 Chapter 20: Windows Communication Foundation ........................................695 Part III: Appendixes Appendix A: C# Keywords ...........................................................................749 Appendix B: Examining the .Net Class Libraries Using the Object Browser ....757 Appendix C: Generating Documentation for Your C# Applications .................765 Index .........................................................................................................781 ffirs.indd i 10/1/08 12:13:05 PM ffirs.indd ii 10/1/08 12:13:06 PM C# 2008 Programmer’s Reference ffirs.indd iii 10/1/08 12:13:06 PM ffirs.indd iv 10/1/08 12:13:06 PM C# 2008 Programmer’s Reference Wei-Meng Lee Wiley Publishing, Inc. ffirs.indd v 10/1/08 12:13:06 PM C# 2008 Programmer’s Reference Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-28581-7 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Library of Congress Cataloging-in-Publication Data Lee, Wei-Meng. C# 2008 programmer’s reference / Wei-Meng Lee. p. cm. Includes index. ISBN 978-0-470-28581-7 (paper/website) 1. C# (Computer program language) I. Title. QA76.73.C154L33 2009 005.13'3—dc22 2009036345 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission