Tải bản đầy đủ (.pdf) (1,082 trang)

Beginning Visual C# 2010 docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (38.05 MB, 1,082 trang )

Wrox Programmer to Programmer™
Join the discussion @ p2p.wrox.com
Watson, et al.
$44.99 USA
$53.99 CAN
Programming Languages / C# (.Net)
Learn programming with C#
2010 and the .NET framework
wrox.com
Programmer
Forums
Join our Programmer to
Programmer forums to ask
and answer programming
questions about this book,
join discussions on the
hottest topics in the industry,
and connect with fellow
programmers from around
the world.
Code Downloads
Take advantage of free code
samples from this book, as
well as code samples from
hundreds of other books, all
ready to use.
Read More
Find articles, ebooks, sample
chapters and tables of contents
for hundreds of books, and
more reference resources on


programming topics that matter
to you.
Beginning with C# 2010 programming basics such as variables, flow
control, and object oriented programming, this invaluable book then
moves into web and Windows programming and data access (databases
and XML). All the while, the expert team of authors focuses on the
tools that you need to program C#, the Visual C# 2010 develop-
ment environment in Visual Studio
®
2010. The step-by-step instruc-
tions and constructive examples featured throughout the book will
show you how to program confidently with useful code in C# 2010.
Beginning Visual C# 2010:
• Explains basic C# 2010 syntax, including variables and expressions
• Reviews generics and explains how to define and use them
• Covers Windows
®
programming and Windows Forms
• Examines language enhancements, Lambda expressions,
and extension methods
• Shows how to deploy Windows applications
• Discusses XML and provides an introduction to LINQ
• Delves into debugging and error handling
• Demonstrates useful techniques for WPF and WCF
Karli Watson is an author and a consultant for Infusion.
Christian Nagel is an author, Microsoft Regional Director, and software architect
with more than 20 years of experience.
Jacob Hammer Pedersen is an author and senior application developer at
Elbek & Vejrup, Denmark.
Jon D. Reid is Software Engineering Manager at Metrix LLC.

Morgan Skinner is a consultant for Microsoft UK.
Wrox Beginning guides are crafted to make learning programming languages
and technologies easier than you think, providing a structured, tutorial format
that will guide you through all the techniques involved.
Beginning
Beginning
Visual C#
®
2010
Visual C#
®
2010
Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner
Get more out of
wrox.com
Programmer to Programmer

Interact
Take an active role online by participating in our
P2P forums @ p2p.wrox.com
Wrox Online Library
Hundreds of our books are available online
through Books24x7.com
Wrox Blox
Download short informational pieces and code
to keep you up to date and out of trouble!
Join the Community
Sign up for our free monthly newsletter at
newsletter.wrox.com
Browse

Ready for more Wrox? We have books and
e-books available on .NET, SQL Server, Java,
XML, Visual Basic, C#/ C++, and much more!
Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing
Related Wrox Books
Beginning ASP.NET 4: in C# and VB
ISBN: 978-0-470-50221-1
This introductory book offers helpful examples and step-by-step format and has code examples written in both C# and Visual
Basic. With this book you will gradually build a Web site example that takes you through the processes of building basic ASP.NET
Web pages, adding features with pre-built server controls, designing consistent pages, displaying data, and more.
Beginning Visual Basic 2010
ISBN: 978-0-470-50222-8
This book not only shows you how to write Windows applications, Web applications with ASP.NET, and Windows mobile and
embedded CE apps with Visual Basic 2010, but you’ll also get a thorough grounding in the basic nuts-and-bolts of writing good code.
You’ll be exposed to the very latest VB tools and techniques with coverage of both the Visual Studio 2010 and .NET 4 releases.
Professional ASP.NET 4: in C# and VB
ISBN: 978-0-470-50220-4
Written by three highly recognized and regarded ASP.NET experts, this book provides all-encompassing coverage on ASP.NET 4 and
offers a unique approach of featuring examples in both C# and VB, as is the incomparable coverage of core ASP.NET. After a fast-
paced refresher on essentials such as server controls, the book delves into expert coverage of all the latest capabilities of ASP.NET 4.
You’ll learn site navigation, personalization, membership, role management, security, and more.
Professional C# 4 and .NET 4
ISBN: 978-0-470-50225-9
After a quick refresher on C# basics, the author dream team moves on to provide you with details of language and framework with C#,
working in Visual Studio 2010 with C#, and more. With this book, you’ll quickly get up to date on all the newest capabilities of C# 4.
Professional Visual Basic 2010 and .NET 4
ISBN: 978-0-470-50224-2
If you’ve already covered the basics and want to dive deep into VB and .NET topics that professional programmers use most, this is

your guide. You’ll explore all the new features of Visual Basic 2010 as well as all the essential functions that you need, including .NET
features such as LINQ to SQL, LINQ to XML, WCF, and more. Plus, you’ll examine exception handling and debugging, Visual Studio
features, and ASP.NET web programming.
Professional Visual Studio 2010
ISBN: 978-0-470-54865-3
Written by an author team of veteran programmers and developers, this book gets you quickly up to speed on what you can expect from
Visual Studio 2010. Packed with helpful examples, this comprehensive guide examines the features of Visual Studio 2010, and walks you
through every facet of the Integrated Development Environment (IDE), from common tasks and functions to its powerful tools.
Visual Studio 2010 and .NET 4 Six-in-One
ISBN: 978-0-470-49948-1
This comprehensive resource offers a single resource for all you need to know to get productive with .NET 4. This reviews all the
important features of .NET 4, including .NET charting and ASP.NET charting, ASP.NET dynamic data and jQuery, and F#. The coverage
is divided into six distinctive parts for easy navigation and offers a practical approach and complete examples.
WPF Programmer’s Reference: Windows Presentation Foundation with C# 2010 and .NET 4
ISBN: 978-0-470-47722-9
Written by a leading expert on Microsoft graphics programming, this richly illustrated book provides an introduction to WPF development
and explains fundamental WPF concepts. It is packed with helpful examples and progresses through a range of topics that gradually
increase in their complexity.
Visual Basic 2010 Programmer’s Reference
ISBN: 978-0-470-49983-2
Visual Basic 2010 Programmer’s Reference is a language tutorial and a reference guide to the 2010 release of Visual Basic.
The tutorial provides basic material suitable for beginners but also includes in-depth content for more advanced developers.
BEGINNING VISUAL C# 2010
INTRODUCTION xxxiii
 PART I THE C# LANGUAGE
CHAPTER 1 IntroducingC# 3
CHAPTER 2 WritingaC#Program 13
CHAPTER 3 VariablesandExpressions 31
CHAPTER 4 FlowControl 59
CHAPTER 5 MoreAboutVariables 93

CHAPTER 6 Functions 125
CHAPTER 7 Debugging and Error Handling 155
CHAPTER 8 IntroductiontoObject-OrientedProgramming 185
CHAPTER 9 DefiningClasses 209
CHAPTER 10 DefiningClassMembers 241
CHAPTER 11 Collections,Comparisons,andConversions 277
CHAPTER 12 Generics 331
CHAPTER 13 AdditionalOOPTechniques 373
CHAPTER 14 C#LanguageEnhancements 401
 PART II WINDOWS PROGRAMMING
CHAPTER 15 BasicWindowsProgramming 447
CHAPTER 16 AdvancedWindowsFormsFeatures 497
CHAPTER 17 DeployingWindowsApplications 533
 PART III WEB PROGRAMMING
CHAPTER 18 ASP.NETWebProgramming 577
CHAPTER 19 WebServices 637
CHAPTER 20 DeployingWebApplications 665
Continues
 PART IV DATA ACCESS
CHAPTER 21 FileSystemData 683
CHAPTER 22 XML 725
CHAPTER 23 IntroductiontoLINQ 753
CHAPTER 24 Applying LINQ 795
 PART V ADDITIONAL TECHNIQUES
CHAPTER 25 WindowsPresentationFoundation 829
CHAPTER 26 WindowsCommunicationFoundation 899
CHAPTER 27 WindowsWorkflowFoundation 935
APPENDIX A ExerciseSolutions 957
INDEX 1009
BEGINNING

Visual C# 2010

BEGINNING
Visual C# 2010
Karli Watson
Christian Nagel
Jacob Hammer Pedersen
Jon Reid
Morgan Skinner
Wiley Publishing, Inc.
Beginning Visual C# 2010
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-50226-6
Manufactured in the United States of America
10987654321
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 should be addressed to the
Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-
6008, or online at
/>.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with

respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or pro-
motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold
with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services.
If professional assistance is required, the services of a competent professional person should be sought. Neither the pub-
lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to
in this work as a citation and/or a potential source of further information does not mean that the author or the publisher
endorses the information the organization or Web site may provide or recommendations it may make. Further, readers
should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was
written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available
in electronic books.
Library of Congress Control Number: 2010920663
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries,
and may not be used without written permission. C# is a registered trademark of Microsoft Corporation in the United States
and/or other countries. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not
associated with any product or vendor mentioned in this book.
for Donna
—Karli Watson

ABOUT THE AUTHORS
KARLI WATSON is consultant at Infusion Development (
www.infusion.com
), a technology architect at
Boost.net (
www.boost.net
), and a freelance IT specialist, author, and developer. For the most part, he

immerses himself in .NET (in particular C# and lately WPF) and has written numerous books in the
field for several publishers. He specializes in communicating complex ideas in a way that is accessible
to anyone with a passion to learn, and spends much of his time playing with new technology to find
new things to teach people about.
During those (seemingly few) times where he isn’t doing the above, Karli will probably be wishing
he was hurtling down a mountain on a snowboard. Or possibly trying to get his novel published.
Either way, you’ll know him by his brightly colored clothes. You can also find him tweeting online at
www.twitter.com/karlequin
, and maybe one day he’ll get around to making himself a website. Karli
authored chapters 1 through 14, 21, 25 and 26.
CHRISTIAN NAGEL is a Microsoft Regional Director and Microsoft MVP, an associate of Thinktecture,
and owner of CN Innovation. He is a software architect and developer who offers training and con-
sulting on how to develop Microsoft .NET solutions. He looks back on more than 25 years of software
development experience. Christian started his computing career with PDP 11 and VAX/VMS systems,
covering a variety of languages and platforms. Since 2000, when .NET was just a technology preview,
he has been working with various .NET technologies to build numerous .NET solutions. With his pro-
found knowledge of Microsoft technologies, he has written numerous .NET books, and is certified as a
Microsoft Certified Trainer and Professional Developer. Christian speaks at international conferences
such as TechEd and Tech Days, and started INETA Europe to support .NET user groups. You can
contact Christian via his web sites,
www.cninnovation.com
and
www.thinktecture.com
and follow his
tweets on
www.twitter.com/christiannagel
. Christian wrote chapters 17 through 20.
JACOB HAMMER PEDERSEN is a Senior Application Developer at Elbek & Vejrup. He just about started
programming when he was able to spell the word ‘BASIC’, which, incidentally is the first programming
language he ever used. He started programming the PC in the early ’90s, using Pascal but soon changed

his focus to C++, which still holds his interest. In the mid ’90s his focus changed again, this time to
Visual Basic. In the summer of 2000 he discovered C# and has been happily exploring it ever since.
Primarily working on the Microsoft platforms, his other expertise includes MS Office development,
SQL Server, COM and Visual Basic.Net.
A Danish citizen, Jacob works and lives in Aarhus, Denmark. He authored chapters 15, 16, and 22.
JON D. REID is a software engineering manager at Metrix LLC, an ISV of field service management soft-
ware for the Microsoft environment. He has co-authored a variety .NET books, including Beginning
Visual C# 2008, Beginning C# Databases: From Novice to Professional, Pro Visual Studio .NET, and
many others. Jon wrote chapters 23 and 24.
ABOUT THE AUTHORS
MORGAN SKINNER began his computing career at a young age on the Sinclair ZX80 at school, where
he was underwhelmed by some code a teacher had written and so began programming in assembly
language. Since then he’s used all sorts of languages and platforms, including VAX Macro Assembler,
Pascal, Modula2, Smalltalk, X86 assembly language, PowerBuilder, C/C++, VB, and currently C#
(of course). He’s been programming in .NET since the PDC release in 2000, and liked it so much he
joined Microsoft in 2001. He now works in premier support for developers and spends most of his time
assisting customers with C#. Morgan wrapped up the book by authoring chapter 27. You can reach
Morgan at
www.morganskinner.com
.
x
ABOUT THE TECHNICAL EDITOR
A ‘‘blue-badge’’ .NET architect and developer at Intel Corporation since March 2007, Doug Holland
is part of the Visual Computing Group and is presently working within an advanced tools and devel-
opment team with an emphasis on chipset and driver testing. Doug Holland holds a Master’s Degree
in Software Engineering from Oxford University and has been awarded both the Microsoft MVP and
Intel Black Belt Developer awards. Outside of work, Doug enjoys spending time with his wife and four
children; and is also an officer in the Civil Air Patrol/U.S. Air Force Auxiliary. Beyond architecting and
developing software you can often find Doug at the local airport flying Cessnas over the California
landscape.


CREDITS
ACQUISITIONS EDITOR
Paul Reese
DEVELOPMENT EDITOR
Maryann Steinhart
PROJECT EDITOR
Ami Frank Sullivan
TECHNICAL EDITOR
Doug Holland
PRODUCTION EDITOR
Rebecca Anderson
COPY EDITOR
Luann Rouff
EDITORIAL DIRECTOR
Robyn B. Siesky
EDITORIAL MANAGER
Mary Beth Wakefield
ASSOCIATE DIRECTOR OF MARKETING
David Mayhew
PRODUCTION MANAGER
Tim Tate
VICE PRESIDENT AND EXECUTIVE
GROUP PUBLISHER
Richard Swadley
VICE PRESIDENT AND EXECUTIVE
PUBLISHER
Barry Pruett
ASSOCIATE PUBLISHER
Jim Minatel

PROJECT COORDINATOR, COVER
Lynsey Stanford
PROOFREADER
Josh Chase, Word One
INDEXER
J&JIndexing
COVER DESIGNER
Michael E. Trent
COVER IMAGE
© Lisa Loyd/istockphoto

ACKNOWLEDGMENTS
FROM KARLI WATSON: Thanks to all at Wiley for their support and assistance on this project, as well
as their understanding and flexibility in dealing with an author who never seems to have enough time
to write. Special thanks to my editor for this book, Ami Sullivan, for adding sparkle and making this
book shine. Also, thanks to friends, family, and work colleagues for understanding why I haven’t have
time for much socializing lately, and to Donna, as always, for all her support and for putting up with
all the late nights.
FROM CHRISTIAN NAGEL: To my two girls Angela and Stephanie. It’s great to have you. Thanks for
your great support and the big love you gave me during the hardest time of my life in 2009. Without
you I couldn’t have made it through. Stephanie, while not born yet, you were my biggest motivation
during that time. I love you both!
Also, a big thank you to my co-authors and the team at Wrox/Wiley for getting a great book out.

CONTENTS
INTRODUCTION xxxiii
PART I: THE C# LANGUAGE
CHAPTER 1: INTRODUCING C# 3
What is the .NET Framework? 3
What’s in the .NET Framework? 4

Writing Applications Using the .NET Framework 5
CIL and JIT 5
Assemblies 5
Managed Code 6
Garbage Collection 6
Fitting It Together 7
Linking 8
What is C#? 8
Applications You Can Write with C# 9
C# in This Book 10
Visual Studio 2010 10
Visual Studio 2010 Express Products 11
Solutions 11
Summary 11
CHAPTER 2: WRITING A C# PROGRAM 13
The Development Environments 14
Visual Studio 2010 14
Visual C# 2010 Express Edition 17
Console Applications 18
The Solution Explorer 22
The Properties Window 23
The Error List Window 23
Windows Forms Applications 24
Summary 28
CHAPTER 3: VARIABLES AND EXPRESSIONS 31
Basic C# Syntax 32
CONTENTS
Basic C# Console Application Structure 34
Variables 35
Simple Types 36

Variable Naming 40
Naming Conventions 41
Literal Values 42
String Literals 43
Variable Declaration and Assignment 44
Expressions 45
Mathematical Operators 45
Assignment Operators 50
Operator Precedence 51
Namespaces 51
Summary 55
CHAPTER 4: FLOW CONTROL 59
Boolean Logic 59
Boolean Assignment Operators 62
Bitwise Operators 64
Operator Precedence Updated 68
The goto Statement 68
Branching 69
The Ternary Operator 70
The if Statement 70
Checking More Conditions Using if Statements 73
The switch Statement 74
Looping 77
do Loops 78
while Loops 80
for Loops 83
Interrupting Loops 87
Infinite Loops 88
Summary 89
CHAPTER 5: MORE ABOUT VARIABLES 93

Type Conversion 94
Implicit Conversions 94
Explicit Conversions 96
Explicit Conversions Using the Convert Commands 99
Complex Variable Types 102
Enumerations 102
xviii
CONTENTS
Defining Enumerations 103
Structs 107
Defining Structs 107
Arrays 110
Declaring Arrays 110
foreach Loops 113
Multidimensional Arrays 113
Arrays of Arrays 115
String Manipulation 116
Summary 121
CHAPTER 6: FUNCTIONS 125
Defining and Using Functions 126
Return Values 128
Parameters 130
Parameter Matching 132
Parameter Arrays 132
Reference and Value Parameters 134
Out Parameters 136
Variable Scope 137
Variable Scope in Other Structures 140
Parameters and Return Values versus Global Data 142
The Main() Function 143

Struct Functions 146
Overloading Functions 147
Delegates 149
Summary 152
CHAPTER 7: DEBUGGING AND ERROR HANDLING 155
Debugging in VS and VCE 156
Debugging in Nonbreak (Normal) Mode 157
Outputting Debugging Information 158
Tracepoints 163
Diagnostics Output Versus Tracepoints 164
Debugging in Break Mode 166
Entering Break Mode 166
Monitoring Variable Content 170
Stepping Through Code 172
Immediate and Command Windows 173
The Call Stack Window 174
Error Handling 175
try catch finally 176
xix
CONTENTS
Listing and Configuring Exceptions 181
Notes on Exception Handling 182
Summary 183
CHAPTER 8: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING 185
What Is Object-Oriented Programming? 186
What Is an Object? 187
Properties and Fields 188
Methods 189
Everything’s an Object 189
The Life Cycle of an Object 190

Constructors 190
Destructors 191
Static and Instance Class Members 191
Static Constructors 191
Static Classes 192
OOP Techniques 192
Interfaces 193
Disposable Objects 194
Inheritance 194
Polymorphism 196
Interface Polymorphism 197
Relationships Between Objects 198
Containment 198
Collections 199
Operator Overloading 200
Events 200
Reference Types Versus Value Types 201
OOP in Windows Applications 201
Summary 204
CHAPTER 9: DEFINING CLASSES 209
Class Definitions in C# 209
Interface Definitions 212
System.Object 215
Constructors and Destructors 217
Constructor Execution Sequence 218
OOP Tools in VS and VCE 222
The Class View Window 222
The Object Browser 224
Adding Classes 226
Class Diagrams 227

xx
CONTENTS
Class Library Projects 229
Interfaces Versus Abstract Classes 232
Struct Types 235
Shallow Copying Versus Deep Copying 237
Summary 237
CHAPTER 10: DEFINING CLASS MEMBERS 241
Member Definitions 241
Defining Fields 242
Defining Methods 242
Defining Properties 244
Adding Members from a Class Diagram 249
Adding Methods 250
Adding Properties 251
Adding Fields 252
Refactoring Members 252
Automatic Properties 253
Additional Class Member Topics 253
Hiding Base Class Methods 254
Calling Overridden or Hidden Base Class Methods 255
The this Keyword 256
Nested Type Definitions 257
Interface Implementation 257
Implementing Interfaces in Classes 258
Explicit Interface Member Implementation 260
Adding Property Accessors with Nonpublic Accessibility 260
Partial Class Definitions 261
Partial Method Definitions 262
Example Application 264

Planning the Application 264
The Card Class 264
The Deck Class 265
Writing the Class Library 265
Adding the Suit and Rank Enumerations 266
Adding the Card Class 268
Adding the Deck Class 269
A Client Application for the Class Library 272
The Call Hierarchy Window 274
Summary 275
CHAPTER 11: COLLECTIONS, COMPARISONS, AND CONVERSIONS 277
Collections 278
xxi
CONTENTS
Using Collections 278
Defining Collections 284
Indexers 286
Adding a Cards Collection to CardLib 288
Keyed Collections and IDictionary 291
Iterators 293
Iterators and Collections 297
Deep Copying 299
Adding Deep Copying to CardLib 301
Comparisons 303
Type Comparisons 303
Boxing and Unboxing 303
The is Operator 305
Value Comparisons 308
Operator Overloading 308
Adding Operator Overloads to CardLib 313

The IComparable and IComparer Interfaces 318
Sorting Collections Using the IComparable and IComparer Interfaces 320
Conversions 324
Overloading Conversion Operators 324
The as Operator 326
Summary 327
CHAPTER 12: GENERICS 331
What Are Generics? 332
Using Generics 333
Nullable Types 333
Operators and Nullable Types 334
The ?? Operator 336
The System.Collections.Generics Namespace 340
List<T> 341
Sorting and Searching Generic Lists 343
Dictionary<K, V> 349
Modifying CardLib to Use a Generic Collection Class 350
Defining Generic Types 351
Defining Generic Classes 351
The default Keyword 354
Constraining Types 354
Inheriting from Generic Classes 361
Generic Operators 362
Generic Structs 363
Defining Generic Interfaces 364
Defining Generic Methods 364
xxii
CONTENTS
Defining Generic Delegates 366
Variance 366

Covariance 367
Contravariance 368
Summary 369
CHAPTER 13: ADDITIONAL OOP TECHNIQUES 373
The :: Operator and the Global Namespace Qualifier 373
Custom Exceptions 375
Adding Custom Exceptions to CardLib 375
Events 377
What Is an Event? 377
Handling Events 378
Defining Events 380
Multipurpose Event Handlers 385
The EventHandler and Generic EventHandler<T> Types 388
Return Values and Event Handlers 388
Anonymous Methods 389
Expanding and Using CardLib 389
A Card Game Client for CardLib 390
Summary 398
CHAPTER 14: C# LANGUAGE ENHANCEMENTS 401
Initializers 402
Object Initializers 402
Collection Initializers 404
Type Inference 407
Anonymous Types 409
Dynamic Lookup 413
The dynamic Type 414
IDynamicMetaObjectProvider 417
Advanced Method Parameters 418
Optional Parameters 418
Optional Parameter Values 419

Optional Parameter Order 420
Named Parameters 420
Named and Optional Parameter Guidelines 424
Extension Methods 424
Lambda Expressions 429
Anonymous Methods Recap 429
Lambda Expressions for Anonymous Methods 430
Lambda Expression Parameters 434
xxiii

×