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

visual studio 2010 and .net 4 six in one

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 (37.94 MB, 1,274 trang )

www.it-ebooks.info
www.it-ebooks.info
VISUAL STUDIO® 2010 AND .NET 4
SIX-IN-ONE
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii
PART I VISUAL STUDIO
CHAPTER 1 History of Visual Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
CHAPTER 2 Visual Studio UI Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
CHAPTER 3 Visual Studio Code Snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
CHAPTER 4 Visual Studio Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
CHAPTER 5 Getting the Most Out of the IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
CHAPTER 6 Visual Studio Extensibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
PART II .NET 4
CHAPTER 7 .NET Framework Version History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
CHAPTER 8 Modern UI Frameworks (WPF and Silverlight) . . . . . . . . . . . . . . . . . . . . 297
CHAPTER 9 Windows Communication Foundation (WCF) . . . . . . . . . . . . . . . . . . . . . 375
CHAPTER 10 Enhancements to the .NET Core Framework . . . . . . . . . . . . . . . . . . . . . 399
CHAPTER 11 Enhancements to the .NET Workfl ow Framework . . . . . . . . . . . . . . . . . 489
CHAPTER 12 Enhancements to the .NET Data Framework . . . . . . . . . . . . . . . . . . . . . 563
CHAPTER 13 Enhancements to the .NET Communication Framework . . . . . . . . . . . 581
CHAPTER 14 .NET Charting Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
PART III ASP.NET 4.0
CHAPTER 15 ASP.NET Version History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
CHAPTER 16 ASP.NET Charting Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
CHAPTER 17 ASP.NET Dynamic Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
CHAPTER 18 ASP.NET Model View Controller (MVC) . . . . . . . . . . . . . . . . . . . . . . . . . . .751
CHAPTER 19 ASP.NET Ajax Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
CHAPTER 20 ASP.NET Ajax Control Toolkit and jQuery . . . . . . . . . . . . . . . . . . . . . . . . 893




ffirs.indd iffirs.indd i 9/6/10 7:21:25 PM9/6/10 7:21:25 PM
www.it-ebooks.info
PART IV VB.NET
CHAPTER 21 History of Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
CHAPTER 22 Visual Basic 10.0 Language Improvements . . . . . . . . . . . . . . . . . . . . . . 1007
PART V C#
CHAPTER 23 History of C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1041
CHAPTER 24 C# 4.0 Language Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065
PART VI F#
CHAPTER 25 Visual F# and the Other .NET Languages . . . . . . . . . . . . . . . . . . . . . . . .1103
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1173



ffirs.indd iiffirs.indd ii 9/6/10 7:21:26 PM9/6/10 7:21:26 PM
www.it-ebooks.info
Visual Studio® 2010 and .NET 4
SIX-IN-ONE
ffirs.indd iiiffirs.indd iii 9/6/10 7:21:26 PM9/6/10 7:21:26 PM
www.it-ebooks.info
ffirs.indd ivffirs.indd iv 9/6/10 7:21:26 PM9/6/10 7:21:26 PM
www.it-ebooks.info
Visual Studio® 2010 and .NET 4
SIX-IN-ONE
István Novák
András Velvárt
Adam Granicz
György Balássy
Attila Hajdrik
Mitchel Sellers

Gastón C. Hillar
Ágnes Molnár
Joydip Kanjilal
ffirs.indd vffirs.indd v 9/6/10 7:21:26 PM9/6/10 7:21:26 PM
www.it-ebooks.info
Visual Studio
®
2010 and .NET 4 Six-in-One
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-49948-1
ISBN: 978-1-118-00113-4 (ebk)
ISBN: 978-1-118-00295-7 (ebk)
ISBN: 978-1-118-00298-8 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
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 specifi cally disclaim all warranties, including
without limitation warranties of fi tness for a particular purpose. No warranty may be created or extended by sales or

promotional 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 publisher 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: 2010924589
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trade-
marks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other countries,
and may not be used without written permission. Visual Studio 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.
ffirs.indd viffirs.indd vi 9/6/10 7:21:27 PM9/6/10 7:21:27 PM
www.it-ebooks.info
To Henriett, Eszter and Reka, who supported me in
writing this book with their love and appreciation.
— Istv á n Nov á k
To Á gi, always.
— Gy ö rgy Bal á ssy
First and foremost, I would like to thank my
daughter, Patr í cia Csenge, for always making me
smile and for understanding while I was writing this
book instead of playing with her on weekends. She
is my everything, and I dedicate this book to her.

I also thank my wife, Eszter, for standing beside me
throughout my career and while
I was writing this book.
— Attila Hajdrik
To my son, Kevin, and my nephew, Nicolas.
— Gast ó n C. Hillar
ffirs.indd viiffirs.indd vii 9/6/10 7:21:27 PM9/6/10 7:21:27 PM
www.it-ebooks.info
ffirs.indd viiiffirs.indd viii 9/6/10 7:21:27 PM9/6/10 7:21:27 PM
www.it-ebooks.info
ABOUT THE AUTHORS
ISTV Á N NOV Á K is an associate of Grepton, a Hungarian IT services company.
He works as a software architect and community evangelist. In the last 20 years, he
participated in more than 50 enterprise software development projects. In 2002,
he co - authored the fi rst Hungarian book about .NET development. In 2007, he was
awarded with the Microsoft Most Valuable Professional (MVP) title. He holds a
master ’ s degree from the Technical University of Budapest, Hungary, and also has
a doctoral degree in software technology. He lives in Dunakeszi, Hungary, with his wife and two
daughters. He is a passionate scuba diver. You may have a good chance of meeting him underwater
at the Red Sea in any season of the year.
ANDR Á S VELV Á RT is a Silverlight MVP, with a passion for user experience. As an
accomplished speaker, he gives talks at numerous conferences where Windows
Presentation Foundation (WPF) or Silverlight is the topic. Chapter 8 of this book
feeds from his experience at teaching many Silverlight and WPF classes and work-
shops. He is also the owner of Response Ltd. (
www.response.hu ), a small consulting
and WPF/Silverlight development company in Hungary.
ADAM GRANICZ is the CEO of IntelliFactory, a leading provider of F# training, development, and
consulting services, as well as technologies that enable rapid functional, reactive web development.
As one of the fi rst F# users, he is a key community member and an active F# evangelist. He has been

the co - author of two F# books with Don Syme, the designer of the language. He is a regular speaker
at developer conferences and various industry partner events.
GY Ö RGY BAL Á SSY teaches web portal development as a lecturer at Budapest
University of Technology and Economics. He is a founding member of the local
MSDN Competence Centre (MSDNCC), having an important role in evangelizing the
.NET platform as a speaker, book author, and consultant. He provided leadership in
the foundation of the Hungarian .NET community as a key evangelist on Microsoft
events, technical forums, and as the head of the Portal Technology Group in the
MSDNCC. He is a regular speaker on academic and industrial events, presenting in - depth technical
sessions on .NET, ASP.NET, Offi ce development, and ethical hacking, for which he won the Best
Speaker and the Most Valuable Professional (MVP) Awards in SharePoint and ASP.NET multiple
times. He was selected to be the member of the ASPInsiders group. Since 2005, he has been the
Microsoft Regional Director in Hungary.
ATTILA HAJDRIK has worked in the IT industry for more than 14 years. He is the founder and lead
architect of Eyedea Ltd., a small independent software vendor (ISV) specializing in Rich Internet
Application (RIA) development. Before founding his own company, he worked for 6 years at
Microsoft as an Application Development Consultant, and later as a Senior Consultant in Microsoft
Services. He specialized in .NET - based custom development projects. In 2004, He was awarded an
ffirs.indd ixffirs.indd ix 9/6/10 7:21:28 PM9/6/10 7:21:28 PM
www.it-ebooks.info
ASP.NET Most Valuable Professional (MVP) title. He has experience with all .NET - related tech-
nologies from the back end to the front end. He is addicted to Doman Specifi c Languages, model -
based development, and a big believer in design patterns. His favorite technologies are Silverlight,
Windows Presentation Foundation (WPF), and ASP.NET Model View Controller (MVC).
MITCHEL SELLERS specializes in software development using Microsoft technologies.
He is the CEO of IowaComputerGurus Inc., a Microsoft C# MVP, a Microsoft
Certifi ed Professional, and experienced technical writer. He enjoys spending time
sharing information with the development community through books, blog postings,
and public speaking events. He is also an active participant in the DotNetNuke
development community. For more information on him, visit his website at


.
GAST Ó N C. HILLAR has been working with computers since he was 8 years old.
He began programming with the legendary Texas Instruments TI - 99/4A and
Commodore 64 home computers in the early 1980s. He has worked as developer,
architect, and project manager for many companies in Buenos Aires, Argentina.
He is now an independent IT consultant working for several American, German,
Spanish, and Latin American companies, and a freelance author. He has written four
books in English, contributed chapters to two other books, and has written more than 40 books in
Spanish. He contributes to Dr. Dobb ’ s Go Parallel programming portal (

.com/go - parallel/
), Dr. Dobb ’ s ( ), and is a guest blogger at Intel Software
Network (
). He lives with his wife, Vanesa, and his son, Kevin.
When not tinkering with computers, he enjoys developing and playing with wireless virtual
reality devices and electronic toys with his father, his son, and his nephew, Nico. You can reach
him at
. You can follow him on Twitter at />gastonhillar
. His blog is at .
ÁGNES MOLNÁR has been working with Microsoft technologies and SharePoint since 2001. After
a few years of working as a developer and SharePoint expert, she founded a SharePoint consulting
company in Hungary, Central Europe. She ’ s been working as a senior consultant, and has led
SharePoint implementations at numerous Central European companies. Her main focus is on
architecture, governance, information and knowledge management, and enterprise search. She ’ s a
frequent speaker at conferences around the globe, and is also the co - author of various SharePoint
books.
JOYDIP KANJILAL was awarded a Microsoft Most Valuable Professional (MVP) title in
ASP.NET in 2007, 2008, and 2009. He has more than 12 years of industry experience in IT, with
more than 6 years experience in Microsoft .NET and its related technologies. He was selected as

MSDN Featured Developer of the Fortnight (MSDN), and was also selected as Community Credit
Winner at
www.community - credit.com several times. He has authored numerous books on
ASP - related topics.
ABOUT THE AUTHORS
x
ffirs.indd xffirs.indd x 9/6/10 7:21:28 PM9/6/10 7:21:28 PM
www.it-ebooks.info
ABOUT THE TECHNICAL EDITOR
DOUG PARSONS is a software architect and the director of Ohio Operations for NJI New Media.
His expertise is in web development with a specialization in political websites. Most notably, he has
worked on the 2008 John McCain presidential campaign website and, more recently, Mitt Romney ’ s
offi cial book tour website. In his downtime, he enjoys spending time with his lovely fi anc é e, Marisa,
and their four puppies.
ffirs.indd xiffirs.indd xi 9/6/10 7:21:29 PM9/6/10 7:21:29 PM
www.it-ebooks.info
ffirs.indd xiiffirs.indd xii 9/6/10 7:21:29 PM9/6/10 7:21:29 PM
www.it-ebooks.info
ACQUISITIONS EDITOR
Paul Reese
PROJECT EDITOR
Kevin Shafer
TECHNICAL EDITOR
Doug Parsons
PRODUCTION EDITOR
Rebecca Anderson
COPY EDITOR
Christopher Jones
EDITORIAL DIRECTOR
Robyn B. Siesky

EDITORIAL MANAGER
Mary Beth Wakefi eld
FREELANCER EDITORIAL MANAGER
Rosemarie Graham
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
PROOFREADERS
Josh Chase, Word One New York
James Saturnio, Word One New York
INDEXER
J & J Indexing
COVER DESIGNER
Michael E. Trent
COVER IMAGE
© Andreas Bauer/istockphoto.com
CREDITS
ffirs.indd xiiiffirs.indd xiii 9/6/10 7:21:29 PM9/6/10 7:21:29 PM
www.it-ebooks.info
ffirs.indd xivffirs.indd xiv 9/6/10 7:21:29 PM9/6/10 7:21:29 PM

www.it-ebooks.info
ACKNOWLEDGMENTS
THIS BOOK WOULD NOT BE SO CLEAR in its voice without the contribution of Kevin Shafer, who not
only fi xed our typos and grammar, but added a lot of value by improving our thoughts put down
to paper and ironed out our tangled sentences. Doug Parsons examined the technical content very
carefully, tried all the sample code we prepared, and gave us a lot of suggestions to improve the
understandability of examples. Without his thorough work, samples would contain many more bugs
and ambiguous code details.
— Istv á n Nov á k
I WOULD LIKE TO THANK my wife and family for their support, and coping with the long hours and
nights of writing. A special thank you goes to my friend, István Novák, who got me to write the
Modern UI Frameworks chapter, and kept the project alive even if it meant that he had to write
more than half of the book — a lot more than what his share was.
— András Velvárt
I WOULD LIKE TO THANK Istv á n Nov á k for his help and useful tips he gave me to write this book.
Last but not least, I would like to thank Tam á s Varga for inspiring me to get this book done. ”
— Attila Hajdrik
THIS BOOK STARTED OUT AS MY IDEA and I was the original sole author. However, because of soft-
ware release delays and schedule confl icts, that ended up not being feasible, and I wasn ’ t sure what
would happen with the book. Other authors were brought on to help with the writing. I am very
grateful for the hard work and dedication that each of them gave toward this book. Without their
efforts, the book would have never made it past the overall concept.
This is the second book that I have been an author on with Wiley/Wrox, and I have to say that their
entire team deserves a pat on the back. I would like to call special attention to two individuals. Paul
Reese (Acquisitions Editor) put up with my schedule and availability changes, while still allowing
me the opportunity to be an author on the book. Kevin Shafer (Project Editor) was yet again a
ffirs.indd xvffirs.indd xv 9/6/10 7:21:30 PM9/6/10 7:21:30 PM
www.it-ebooks.info
great person to work with, and helped keep everything moving through the process smoothly. The
technical editors and all other individuals on the project were critical to getting the book fi nalized

and ready to release.
— Mitchel Sellers
I WISH TO ACKNOWLEDGE Paul Reese and Kevin Shafer. Paul gave me the opportunity to be part of
another project of this size and scope. Kevin improved my paragraphs and found the right place for
each code snippet. The reader will notice his great work. Special thanks go to my wife, Vanesa S.
Olsen, because she understood that I needed to work with many computers and mobile devices at
the same time to test each code snippet.
— Gast ó n C. Hillar
ACKNOWLEDGMENTS
xvi
ffirs.indd xviffirs.indd xvi 9/6/10 7:21:30 PM9/6/10 7:21:30 PM
www.it-ebooks.info
CONTENTS
INTRODUCTION xxxiii
PART I: VISUAL STUDIO
CHAPTER 1: HISTORY OF VISUAL STUDIO 3
Roots 4
The First Breakthrough: Visual Basic 4
Other Languages and Tools 4
Visual Studio 97 and 6.0 5
Visual Studio.NET 2002 and 2003 5
Visual Studio 2005 7
Visual Studio 2008 8
Visual Studio 2010 10
Changes in Editions 10
What’s New in Visual Studio 2010 12
Shift to WPF 12
Summary 13
CHAPTER 2: VISUAL STUDIO UI ENHANCEMENTS 15
Basic IDE Overview 15

Exploring the Start Page 15
Understanding Window Management 16
New Project Dialog Window 17
Creating New Projects in a New Way 19
Using the Add Reference Dialog Window 19
Using the Extension Manager 20
Exploring New Daily Development Features 20
Exploring the Code Editor Window 20
Code Navigation 22
Generate From Usage 24
Exploring the Visual Designers 25
WPF Designer 26
XML Schema Designer 27
New Tools for Architects 27
Summary 29
TOC.indd xviiTOC.indd xvii 9/6/10 7:23:12 PM9/6/10 7:23:12 PM
www.it-ebooks.info
CONTENTS
xviii
CHAPTER 3: VISUAL STUDIO CODE SNIPPETS 31
Understanding Code Snippets 32
Using Code Snippets 34
HTML, SQL, and JScript Code Snippets 37
Creating Code Snippets 38
Creating a Simple Code Snippet 38
The Code Snippet File Structure 41
Managing Code Snippets 51
The Code Snippet Manager 52
Code Snippet Storage 53
Adding and Removing Snippets 54

Importing Snippets 54
Advanced Code Snippet Features 56
Multiple Snippets in a File 56
Code Snippets in Other Languages 58
Building Online Code Snippet Providers 59
Snippet Editors 59
Export as Code Snippet Add-In 60
Snippet Designer 61
Snippet Editor 62
Summary 63
CHAPTER 4: VISUAL STUDIO TEMPLATES 65
The Role of Templates 66
Project Templates 67
Item Templates 69
Creating Templates 70
Creating a Simple Project Template 71
Creating a Simple Item Template 76
Template Storage Structure 81
Template Folders 82
The Template Manifest File 84
Customizing Templates 98
Template Parameters 98
Custom Template Parameters 99
Wizards 101
Deploying Templates 110
Exporting and Importing Templates 111
Creating a Template Installation Kit 114
Summary 125
TOC.indd xviiiTOC.indd xviii 9/6/10 7:23:13 PM9/6/10 7:23:13 PM
www.it-ebooks.info

CONTENTS
xix
CHAPTER 5: GETTING THE MOST OUT OF THE IDE 127
Window Management 128
Visual Studio Window Architecture 128
Tool Windows 131
Document Windows 132
Arranging Windows 134
Customizing Menus and Toolbars 138
The Customize Dialog 139
Adding Menus and Commands 140
Creating and Rearranging Toolbars 144
Context Sensitivity 145
IDE Confi guration 145
The Options Dialog 145
Changes in Option Pages 147
Visual Studio Settings 150
Reducing E orts with Keyboard Shortcuts 155
Command Routing and Command Contexts 155
Working with Keyboard Shortcuts 157
Working with Keyboard Mapping Schemes 160
Custom Start Pages 162
Creating Your First Custom Start Page 163
Changing the StartPage.xaml File 173
Accessing the Visual Studio Context 176
Accessing the Visual Studio Object Model 182
A Few More Points About Start Pages 186
Customizing the Toolbox 186
A Lap Around the Toolbox 186
Customizing Toolbox Tabs 189

Adding Items to the Toolbox 190
A Few More Points About Toolbox Customization 193
Visual Studio Gallery 193
Browsing the Visual Studio Gallery 194
Downloading and Installing Components 196
Adding Your Own Contributions to the Gallery 197
Working Together with the Community 198
Summary 198
TOC.indd xixTOC.indd xix 9/6/10 7:23:13 PM9/6/10 7:23:13 PM
www.it-ebooks.info
CONTENTS
xx
CHAPTER 6: VISUAL STUDIO EXTENSIBILITY 201
The Visual Studio Shell and Packages 202
Package Integration 203
Extensibility Out of the Box 204
Extending Visual Studio by Customization 204
Using Macros to Automate Common Tasks 208
Visual Studio Add-Ins 209
Extensions with Visual Studio SDK 210
The Full Power of Extensibility 210
Visual Studio Package Development 211
Editor Extensibility 212
Creating Visual Studio Macros 213
Understanding the Structure of Macros 213
Using the Macros IDE 218
Recording and Developing Macros 221
Macro Samples 225
Creating Visual Studio Add-Ins 229
Add-In Architecture 229

Creating a Simple Add-In 230
Using the Automation Model 239
Going on with Add-In Development 241
Visual Studio Packages in a Nutshell 242
Creating a Package with a Simple Menu Command 242
Debugging the Package 254
Extending the New Editor 255
Extending the Editor with the Managed Extensibility Framework 256
Editor Extensibility Points 258
Creating a Simple Classifi er 260
Summary 275
PART II: .NET 4
CHAPTER 7: .NET FRAMEWORK VERSION HISTORY 279
Before the .NET Framework 279
Win/Win32 Programming in C 279
C++ Programming 280
Programming in Visual Basic 280
Programming in Delphi 281
COM Programming 281
TOC.indd xxTOC.indd xx 9/6/10 7:23:13 PM9/6/10 7:23:13 PM
www.it-ebooks.info
CONTENTS
xxi
The Origin and Goals of the .NET Framework 282
Evolution of the .NET Framework 283
.NET Framework 1.0 286
.NET Framework 1.1 286
.NET Framework 2.0 286
.NET Framework 3.0 287
.NET Framework 3.5 287

.NET Framework 4.0 288
.NET Compact Framework 289
.NET Micro Framework 289
.NET Framework Architecture 289
Common Language Run-time (CLR) 290
Base Class Library 291
Services of the .NET Architecture 292
Main Benefi ts of the .NET Framework 293
Summary 294
CHAPTER 8: MODERN UI FRAMEWORKS (WPF AND SILVERLIGHT) 297
The Importance of User Experience 297
Developers Are from Vulcan, Designers Are from Venus 299
A New Generation of Presentation Frameworks 301
The Ten Pillars of Silverlight 303
XAML 304
Tools for Working with Silverlight (and WPF) 313
Layout 315
Data Binding 322
Styles 330
Templates 332
Animations 341
Media 345
Networking 352
Other Features 355
Windows Presentation Foundation 359
WPF Features not Available in Silverlight 361
Choosing Between WPF and Silverlight 366
Designer - Developer Cooperation in Silverlight and WPF 367
A Common Solution Format 367
Blendability 368

Design Time Sample Data in Blend 369
TOC.indd xxiTOC.indd xxi 9/6/10 7:23:14 PM9/6/10 7:23:14 PM
www.it-ebooks.info
CONTENTS
xxii
SketchFlow 370
Triggers, Actions, and Behaviors 371
Model-View-ViewModel Pattern 372
Summary 373
CHAPTER 9: WINDOWS COMMUNICATION FOUNDATION (WCF) 375
WCF Versus ASMX Web Services 375
A Quick Look at SOA 376
Service 377
Service Provider 377
Service Consumer(s) 377
Service Registry 377
Service Contract 377
Service Proxy 378
Service Lease 378
Message 378
Service Description 378
Advertising and Discovery 378
Building Blocks of the WCF Architecture 378
Getting Started With WCF 381
Creating the WCF Service 382
Defi ning Data Contracts 386
Specifying the Binding Information 387
Hosting the WCF Service 388
Creating the Service Proxy 389
Creating the Service Client — The Service Consumer 391

Working with an Ajax-Enabled WCF Service 392
REST and WCF 394
Implementing a WCF Service Declaratively 394
Defi ning the Service Contract 395
Hosting the Service 396
Implementing the Service Logic Declaratively 396
Summary 398
CHAPTER 10: ENHANCEMENTS TO THE .NET CORE FRAMEWORK 399
Changes in Common Language Run-time 400
In-Process Side-By-Side Execution 400
DLR Integration 402
Type Equivalence 411
TOC.indd xxiiTOC.indd xxii 9/6/10 7:23:14 PM9/6/10 7:23:14 PM
www.it-ebooks.info
CONTENTS
xxiii
Parallel Computing 415
The Challenge of Many-core Shift 416
The Microsoft Approach 418
Parallel LINQ 421
Task Parallel Library 428
Code Contracts 455
Managed Extensibility Framework 463
The Challenge 463
A Simple MEF Example 465
Basic MEF Concepts 471
Composition 477
A Few More Points on MEF 486
Summary 487
CHAPTER 11: ENHANCEMENTS TO THE .NET WORKFLOW

FRAMEWORK 489
An Introduction to WF 4.0 490
The Workfl ow Design Surface 491
The Hello Workfl ow Application 492
Creating Flowcharts and Coded Workfl ows 499
Flowcharts in WF 4.0 500
Code-Only Workfl ows 505
Workfl ow Architecture 509
Workfl owApplication and Hosts 510
Activities 511
Extensions 512
Workfl ow Activity Model Changes 513
Workfl ow Activity Library 517
Primitive Activities 518
Flow Control Activities 518
Workfl ow Run-Time Activities 520
Flowchart-Specifi c Activities 521
Error-Handling Activities 522
Transaction-Handling Activities 523
Collection-Handling Activities 524
Messaging Activities 525
Using the Compensating Transaction Model 527
The ConferenceWorkfl ow Example 527
Implementing Cancellation, Confi rmation, and Compensation 528
Cancellation 530
Compensation 530
TOC.indd xxiiiTOC.indd xxiii 9/6/10 7:23:14 PM9/6/10 7:23:14 PM
www.it-ebooks.info

×