1031 pro c 2010 and the NET 4 platform, 5th edition

1.8K 422 0
1031 pro c 2010 and the  NET 4 platform, 5th edition

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

  CYAN   MAGENTA   YELLOW   BLACK   PANTONE 123 C BOOKS FOR PROFESSIONALS BY PROFESSIONALS ® Pro C# 2010 and the NET Platform, FIFTH EDITION Pro VB 2008 and the NET 3.5 Platform COM and NET Interoperability Expert ASP.NET 2.0 Advanced Application Design Developer’s Workshop to COM and ATL 3.0 • the Dynamic Language Runtime (DLR) • the Task Parallel Library (TPL, including PLINQ) • the ADO.NET Entity Framework (as well as LINQ to EF) • expanded coverage of the Windows Presentation Foundation (WPF) API • improved support for COM interop Andrew Troelsen Microsoft MVP, Visual Developer—Visual C#; Microsoft Certified Trainer (MCT) Companion eBook THE APRESS ROADMAP Introducing NET 4.0 See last page for details on $10 eBook version Accelerated C# 2010 Pro C# 2010 and the NET Platform Visual C# 2010 Recipes Pro ASP.NET in C# 2010 Pro Windows Azure Pro WPF in C# 2010 Pro Dynamic NET 4.0 Applications www.apress.com ISBN 978-1-4302-2549-2 59 9 US $59.99 C# 2010 and the NET 4 Platform Exploring the NET universe using curly brackets FIFTH EDITION FIFTH EDITION Troelsen SOURCE CODE ONLINE Pro and the If you’re checking out this book for the first time, understand that it targets experienced software professionals and students of computer science—so please don’t expect three chapters devoted to “variable scope” here! The mission of this text is to provide you with a rock-solid foundation in the C# programming language (including a full discussion of OOP) and the critical aspects of the NET platform Once you digest the information presented in the book you hold in your hands, you’ll be in a perfect position to apply this knowledge to your specific programming assignments, and you’ll be well-equipped to explore the NET universe on your own terms Pro C# 2010 Andrew Troelsen, author of The C# language and the NET platform have existed for quite some time and have become a mainstay of modern software development As expected, NET brings a wealth of new APIs to the base class libraries and several new syntactical constructs to C# For example, it is now possible to create C# methods that support optional and named arguments As well, you are able to resolve types completely at runtime using the new dynamic keyword As far as APIs are concerned, this edition of Pro C# 2010 and the NET Platform will cover a number of new details, including: Companion eBook Available NET Platform Dear Reader, THE EXPERT’S VOICE ® IN NET Andrew Troelsen Shelve in: Programming | C# User level: Intermediate–Advanced 781430 225492 www.it-ebooks.info this print for content only—size & color not accurate 7.5 x 9.25 spine = 3.28125" 1752 page count 544ppi Pro C# 2010 and the NET Platform Fifth Edition ■■■ Andrew Troelsen www.it-ebooks.info Pro C# 2010 and the NET Platform, Fifth Edition Copyright © 2010 by Andrew Troelsen All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN-13 (pbk): 978-1-4302-2549-2 ISBN-13 (electronic): 978-1-4302-2550-8 Printed and bound in the United States of America Trademarked names may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark President and Publisher: Paul Manning Lead Editor: Ewan Buckingham Technical Reviewer: Andy Olsen Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Debra Kelly Copy Editors: Patrick Meader, Katie Stence, and Sharon Terdeman Compositor: folio Indexer: Potomac Indexers Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com For information on translations, please e-mail rights@apress.com, or visit www.apress.com Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales The information in this book is distributed on an “as is” basis, without warranty Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work The source code for this book is available to readers at www.apress.com www.it-ebooks.info Contents at a Glance Contents viii About the Author xxv About the Technical Reviewer xxvi Acknowledgments xxvii Introduction xxviii ■ ■ ■ Part 1: Introducing C# and the NET Platform .1 ■ Chapter 1: The Philosophy of NET ■ Chapter 2: Building C# Applications .41 ■ ■ ■ Part 2: Core C# Programming Constructs 71 ■ Chapter 3: Core C# Programming Constructs, Part I 73 ■ Chapter 4: Core C# Programming Constructs, Part II .125 ■ Chapter 5: Defining Encapsulated Class Types 167 ■ Chapter 6: Understanding Inheritance and Polymorphism .219 ■ Chapter 7: Understanding Structured Exception Handling 259 ■ Chapter 8: Understanding Object Lifetime 289 ■ ■ ■ Part 3: Advanced C# Programming Constructs 319 ■ Chapter 9: Working with Interfaces 321 ■ Chapter 10: Understanding Generics 361 v www.it-ebooks.info ■ CONTENTS AT A GLANCE ■ Chapter 11: Delegates, Events, and Lambdas 397 ■ Chapter 12: Advanced C# Language Features 439 ■ Chapter 13: LINQ to Objects 489 ■ ■ ■ Part 4: Programming with NET Assemblies .523 ■ Chapter 14: Configuring NET Assemblies 525 ■ Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming 581 ■ Chapter 16: Processes, AppDomains, and Object Contexts 625 ■ Chapter 17: Understanding CIL and the Role of Dynamic Assemblies 653 ■ Chapter 18: Dynamic Types and the Dynamic Language Runtime .701 ■ ■ ■ Part 5: Introducing the NET Base Class Libraries 725 ■ Chapter 19: Multithreaded and Parallel Programming .727 ■ Chapter 20: File I/O and Object Serialization 775 ■ Chapter 21: ADO.NET Part I: The Connected Layer 825 ■ Chapter 22: ADO.NET Part II: The Disconnected Layer 885 ■ Chapter 23: ADO.NET Part III: The Entity Framework 951 ■ Chapter 24: Introducing LINQ to XML 993 ■ Chapter 25: Introducing Windows Communication Foundation .1013 ■ Chapter 26: Introducing Windows Workflow Foundation 4.0 1077 ■ ■ ■ Part 6: Building Desktop User Interfaces with WPF 1115 ■ Chapter 27: Introducing Windows Presentation Foundation and XAML 1117 ■ Chapter 28: Programming with WPF Controls 1179 ■ Chapter 29: WPF Graphics Rendering Services 1245 ■ Chapter 30: WPF Resources, Animations, and Styles .1285 ■ Chapter 31: WPF Control Templates and UserControls 1325 vi www.it-ebooks.info ■ CONTENTS AT A GLANCE ■ ■ ■ Part 7: Building Web Applications with ASP.NET 1377 ■ Chapter 32: Building ASP.NET Web Pages 1379 ■ Chapter 33: ASP.NET Web Controls, Master Pages and Themes 1429 ■ Chapter 34: ASP.NET State Management Techniques .1473 ■ Appendix A: Programming with Windows Forms .1511 ■ Appendix B: Platform-Independent NET Development with Mono 1561 ■ Index .1583 vii www.it-ebooks.info ■ CONTENTS Contents About the Author xxv About the Technical Reviewer xxvi Acknowledgments xxvii Introduction xxviii ■ ■ ■ Part 1: Introducing C# and the NET Platform .1 ■ Chapter 1: The Philosophy of NET Understanding the Previous State of Affairs The NET Solution Introducing the Building Blocks of the NET Platform (the CLR, CTS, and CLS) .7 Additional NET-Aware Programming Languages 10 An Overview of NET Assemblies .12 Understanding the Common Type System .19 Understanding the Common Language Specification 23 Understanding the Common Language Runtime .25 The Assembly/Namespace/Type Distinction 27 Exploring an Assembly Using ildasm.exe 33 Exploring an Assembly Using Reflector 35 Deploying the NET Runtime 36 viii www.it-ebooks.info ■ CONTENTS The Platform-Independent Nature of NET .37 Summary 39 ■ Chapter 2: Building C# Applications .41 The Role of the NET Framework 4.0 SDK .41 Building C# Applications Using csc.exe 42 Building NET Applications Using Notepad++ 49 Building NET Applications Using SharpDevelop 50 Building NET Applications Using Visual C# 2010 Express 53 Building NET Applications Using Visual Studio 2010 54 Summary 69 ■ ■ ■ Part 2: Core C# Programming Constructs 71 ■ Chapter 3: Core C# Programming Constructs, Part I 73 The Anatomy of a Simple C# Program 73 An Interesting Aside: Some Additional Members of the System.Environment Class .79 The System.Console Class .81 System Data Types and C# Shorthand Notation 86 Working with String Data .97 Narrowing and Widening Data Type Conversions 106 Understanding Implicitly Typed Local Variables 112 C# Iteration Constructs 117 Decision Constructs and the Relational/Equality Operators 119 Summary .122 ■ Chapter 4: Core C# Programming Constructs, Part II .125 Methods and Parameter Modifiers 125 Understanding C# Arrays .137 Understanding the Enum Type .144 ix www.it-ebooks.info ■ CONTENTS Understanding the Structure Type .151 Understanding Value Types and Reference Types .154 Understanding C# Nullable Types 162 Summary .165 ■ Chapter 5: Defining Encapsulated Class Types 167 Introducing the C# Class Type .167 Understanding Constructors 170 The Role of the this Keyword .174 Understanding the static Keyword .181 Defining the Pillars of OOP 188 C# Access Modifiers 192 The First Pillar: C#’s Encapsulation Services .194 Understanding Automatic Properties 206 Understanding Object Initializer Syntax .210 Working with Constant Field Data 214 Understanding Partial Types 217 Summary .218 ■ Chapter 6: Understanding Inheritance and Polymorphism .219 The Basic Mechanics of Inheritance 219 Revising Visual Studio Class Diagrams 224 The Second Pillar of OOP: The Details of Inheritance 226 Programming for Containment/Delegation 232 The Third Pillar of OOP: C#’s Polymorphic Support .235 Understanding Base Class/Derived Class Casting Rules .247 The Master Parent Class: System.Object .250 Summary .258 x www.it-ebooks.info ■ CONTENTS ■ Chapter 7: Understanding Structured Exception Handling 259 Ode to Errors, Bugs, and Exceptions .259 The Role of NET Exception Handling 260 The Simplest Possible Example .263 Configuring the State of an Exception 267 System-Level Exceptions (System.SystemException) 272 Application-Level Exceptions (System.ApplicationException) .273 Processing Multiple Exceptions .277 Who Is Throwing What? 282 The Result of Unhandled Exceptions .283 Debugging Unhandled Exceptions Using Visual Studio 284 A Brief Word Regarding Corrupted State Exceptions (CSE) 285 Summary .287 ■ Chapter 8: Understanding Object Lifetime 289 Classes, Objects, and References 289 The Basics of Object Lifetime 291 The Role of Application Roots 294 Understanding Object Generations 296 Concurrent Garbage Collection under NET 1.0 - 3.5 .297 Background Garbage Collection under NET 4.0 297 The System.GC Type 298 Building Finalizable Objects 302 Building Disposable Objects 305 Building Finalizable and Disposable Types 309 Understanding Lazy Object Instantiation .313 Summary .316 xi www.it-ebooks.info INDEX ■ XAML, declarations, 1159 Variables aspect, 1095 Variables button, 1095, 1098, 1106 Variant data types, 115, 717, 718, 722 VB (Visual Basic) literal syntax, 996—997 VB code, 1097 VB statements, 1094 VB6 Component Object Model (COM) developers, 261 vbc.exe compiler, 24 vbc.exe file, 16 vbnc compiler, Mono, 1569 VBScript language, 1389 VbSnapIn library, 620 VbSnapIn.dll assembly, 618, 623 VbSnapIn.dll library, 621 vector graphics, generating using expression design, 1275—1276 [VehicleDescription] attribute, 610, 612 VehicleDescriptionAttribute attribute, 609, 610 VehicleDescriptionAttribute class, 615 VehicleDescriptionAttributeReader application, 614 Venn diagramming operations, 1268 Venn diagramming tool, LINQ as, 515—516 ver directives, 542, 666 ver token, 542, 562 verbatim strings, 101—102 VerifyDuplicates( ) method, 471, 472, 473 version numbers, setting, 919 Version type, 693 element, 48 Vertical split button, 1170 Vertical value, 1189 VerticalAlignment property, FrameworkElement type, 1133 VerticalContentAlignment property, Control Type, 1133 VeryComplexQueryExpression class, 521 VeryDynamicClass, 706 VES (Virtual Execution System), 37 VideoDrawing object, 1258 VideoDrawing type, 1272 View Class Diagram button, 64, 225, 932 View Code menu option, 1081, 1104, 1554 View Code option, 621, 933, 1513, 1520 View Detail link, 285 View In Browser menu option, 1387, 1388, 1399, 1465 View Inventory menu item, 1452 View Inventory node, 1446 View menu, 56, 58, 60, 65, 223, 568, 608, 939, 1169, 1450 View Source, 1477 view state adding custom data, 1478—1479 demonstrating, 1477—1478 overview, 1476 Viewport3DVisual class, 1277 Viewport3DVisual object, 1258 ViewState property, 1478, 1485 ViewStateApp project, 1477 virtual, 22 virtual directories, IIS, 1381 virtual execution stack, 656 Virtual Execution System (VES), 37 virtual keyword, 125, 236—238, 243 virtual members overriding using Visual Studio 2010, 238—239 sealing, 239 virtual methods, 236, 243, 493 Visibility property, UIElement type, 1134 visibility trait, 22 Visible property, 1432, 1433, 1527, 1529 visual base class and derived child classes, 1277 Visual Basic (VB) literal syntax, 996—997 Visual Basic 6.0, programming language comparison, Visual Basic, building client application, 547—549 Visual Basic compiler, 16, 1565, 1569 Visual Basic Snap-In, 620 Visual C# 2010 Express and Visual C++ 2010 Express, 53 Visual C# 2010 Express, building C# applications with, 53—54 Visual class, 1134, 1258, 1277, 1283 1699 www.it-ebooks.info INDEX ■ Visual Class Designer, Visual Studio 2010, 64—67 visual designer surface, 1519—1520 visual layer, rendering graphical data using DrawingVisual class, 1278—1279 overview, 1277 rendering to custom layout manager, 1280—1282 responding to hit test operations, 1282— 1284 visual base class and derived child classes, 1277 Visual object, 1258 visual state groups, 1366 Visual State Manager (VSM), NET 4.0, 1356, 1366 Visual Studio 2010 AssemblyInfo.cs file, 613 class diagrams, revising, 224—225 Class View utility, 58—59 code expansions, 63—64 configuration files and, 556—558 configuring brushes using, 1258—1260 default namespace of, 531 generating proxy code using, 1047—1048 generating strong names using, 563— 564 HTML designer tools, 1384—1386 implementing interfaces using, 335—336 integrated NET Framework 4.0 documentation, 67—69 New Project dialog box, 56 Object Browser utility, 60 overriding virtual members using, 238— 239 overview, 54 project templates, 1023—1025 refactoring code, 60—63 Solution Explorer Utility overview, 56 referencing external assemblies, 57 viewing Project Properties, 58 unique features of, 55 Visual Class Designer, 64—67 WPF applications, building using Button Click event, implementing, 1175—1176 Closed event, implementing, 1177 designer tools, 1169—1172 GUI, designing, 1173—1174 Loaded event, implementing, 1174 overview, 1167 project templates, 1168 testing, 1177—1178 WPF control templates, building custom {TemplateBinding} markup extension, 1352—1353 ContentPresenter class, 1354 incorporating into styles, 1354—1355 incorporating visual cues using triggers, 1351—1352 overview, 1348 as resources, 1349—1351 WPF controls, 1181—1182 Visual Studio debugger, 284—285 Visual Studio Windows Forms project template initial Form, 1520—1521 overview, 1518 Program class, 1521—1522 visual designer surface, 1519—1520 visually building menu systems, 1522— 1524 visual trees, 1252, 1278, 1341—1348 Visual type, 1135, 1277 Visual Web Developer 2010 Express, 53 VisualBasicCarClient project, 549 VisualBasicCarClient.exe file, 553 VisualBrush class, 1258 VisualBrush type, 1258 VisualChildrenCount property, 1281 VisualCollection container, 1282 VisualCollection variable, 1280, 1281 VisualStateGroup class, 1367 VisualStateManager class, 1367, 1370 VisualTreeHelper class, 1252, 1343 VisualTreeHelper.HitTest( ) method, 1252, 1253, 1283 void return value, 75, 76, 77 1700 www.it-ebooks.info INDEX ■ void value, 127, 171 Vs2010Example application, 56 VSM (Visual State Manager), NET 4.0, 1356, 1366 ■W W3C (World Wide Web Consortium), 995, 1019 WaitCallback delegate, 760 WaitForPendingFinalizers( ) method, System.GC class, 298 WaitHandle class, 735 WaitHandle.WaitOne( ) method, 735 WaitOne( ) method, 735, 748 WaitReason member, ProcessThread type, 633 WAS (Windows Activation Service), 1026 WCF See Windows Communication Foundation WCF (core assemblies of Windows Communication Foundation), 1022 WcfMathService.MyCalc class, 1054 WcfTestClient.exe, 1024, 1058—1059, 1075 web application, 1412 Web Application model, 1413 web application shutdown, handling, 1488 Web Application Templates, Visual Studio, 1412 Web applications, 1412—1413 Web applications and servers ASP.NET development web server, 1382 IIS virtual directories, 1381 overview, 1380 web controls categories of, 1438 data centric, 1439 security, 1440 standard, 1439 web controls, ASP.NET See ASP.NET web controls Web Form, 1408, 1473, 1477, 1485, 1489, 1498 Web Form controls, 1416, 1429 Web Form icon, Solution Explorer, 1408 web method, 1018 Web pages building single file adding data access logic, 1397—1401 ASP.NET control declarations, 1403— 1404 ASP.NET directives, 1401—1403 compilation cycle for single-file pages, 1405—1406 designing UI, 1396—1397 overview, 1395 referencing AutoLotDAL.dll, 1396 "script" block, 1403 building using code files, 1406—1411 Web Parts, 1393 Web servers, posting back to, 1390—1391 Web Service Definition Language (WSDL), 1019, 1021, 1034, 1044, 1055, 1072, 1073 web service specifications (WS-*), 1020 Web Services Addressing (WS-Addressing), 1029 Web Services Basic (WS-Basic), 1029 Web Services Enhancements (WSE), 1019 Web Services Federation (WS-Federation), 1029 Web Services Interoperability Organization (WS-I), 1019, 1029 Web Services Reliability (WS-Reliability), 1028 Web Services SecureConversation (WSSecureConversation), 1030 Web Services Security (WS-Security), 1028, 1030 Web Services Transactions (WSTransactions), 1028 Web Services Trust (WS-Trust), 1030 Web Site dialog box, 1017 Web site directory structure App_Code folder, 1415 overview, 1413 referencing assemblies, 1414—1415 Web sites applications, 1412—1413 1701 www.it-ebooks.info INDEX ■ web User Interface (UI), 1474 Web-Centric service project templates, 1071—1073 WebClient class, 768 Web.config files, 1075, 1427—1428, 1504— 1505 WebControl class, 1404, 1430, 1437, 1438 WebControl types, 1432 webdev.webserver.exe utility, Microsoft NET, 1571 [WebMethod] attribute, 605, 606, 1016, 1018 directive, 1018 website administration utility, ASP.NET, 1428 Website option, 1409 Web.sitemap file, 1445, 1446 Welcome dialog box, 1207 where clauses, 393, 394 where keyword, constraining type parameters using, 393—394 Where( ) method, 517, 519, 520 where operator, 497, 509, 511, 517, 518 where T : class constraint, 392 where T : NameOfBaseClass constraint, 393 where T : NameOfInterface constraint, 393 where T : new( ) constraint, 392 where T : struct constraint, 392 WhereArrayIterator class, 499 While activity, WF 4.0, 1089 while keyword, 682 while loop, 117, 119 widening operation, 106 Width attribute, 1146 Width property, 1133, 1145, 1152, 1187, 1193, 1219, 1304, 1326, 1438, 1527 Width value, 1188, 1189, 1193 wildcard character (*), 47 wildcard token, 562 \Assembly directory, 1578 Window and control adornments, WPF, 1180 Window class overview, 1130 System.Windows.Controls.ContentCon trol, 1131—1132 System.Windows.Controls.Control, 1132 System.Windows.DependencyObject, 1135 System.Windows.FrameworkElement, 1133 System.Windows.Media.Visual, 1134— 1135 System.Windows.Threading.Dispatcher Object, 1135 System.Windows.UIElement, 1134 Window construction, 1138 Window designer, WPF, 1170 window, dirty, 1549 Window menu, 1303 Window objects, 1130, 1135, 1137, 1138, 1155, 1173 Window type, 1121, 1130, 1135, 1137, 1146, 1173, 1175, 1177, 1196, 1204 element, 1155, 1156, 1158, 1159, 1160, 1173, 1175, 1185, 1205, 1232 WindowCollection type, 1129 scope, 1205 Window-derived class, 1137, 1146 Window-derived object, 1138 WindowHeight property, System.Console class, 82 WindowLeft property, System.Console class, 82 scope, 1294 windows closing, 1141—1142 mapping data to C# code, 1150—1151 naturally dirty, 1551 strongly typed, 1137—1138 Windows Activation Service (WAS), 1026 Windows Application Programming Interface (API), 260, 285, 286, 729 Windows Communication Foundation (WCF) 1702 www.it-ebooks.info INDEX ■ addresses, bindings, and contracts (ABCs) addresses, 1031—1032 bindings, 1028—1031 contracts, 1027 building client applications configuring TCP-based binding, 1049—1050 generating proxy code using svcutil.exe, 1046—1047 generating proxy code using Visual Studio 2010, 1047—1048 building services [OperationContract] attributes, 1035 [ServiceContract] attributes, 1034 overview, 1032 service types as operational contracts, 1035—1036 composition of applications, 1025—1027 core assemblies of, 1022 data in one process, 625 designing data contracts examining Web.config files, 1075 implementing service contracts, 1073—1074 overview, 1070 role of *.svc files, 1074 testing services, 1075—1076 using Web-Centric service project templates, 1071—1073 distributed computing APIs NET remoting, 1016 COM+/Enterprise Services, 1015 Distributed Component Object Model (DCOM), 1014—1015 Microsoft Message Queuing (MSMQ), 1015—1016 named pipes, sockets, and P2P, 1019 overview, 1013 XML web services, 1016—1019 features, 1020 hosting services element, 1042 coding against ServiceHost type, 1038 enabling metadata exchange, 1043— 1045 establishing ABCs within App.config files, 1037 ServiceHost type, 1040—1041 specifying base addresses, 1038— 1040 hosting services within Windows services creating Windows service installer, 1064—1065 enabling MEX, 1064 installing Windows service, 1066— 1067 overview, 1061 specifying ABCs in code, 1062—1063 invoking services asynchronously from clients, 1067—1069 overview, 1013 service-oriented architecture (SOA) tenets, 1021—1022 simplifying configuration settings with WCF 4.0 changing settings for bindings, 1053—1054 default endpoints in, 1051—1052 default MEX behavior configuration, 1054—1055 exposing single services using multiple bindings, 1052—1053 overview, 1050 refreshing client proxy and selecting bindings, 1056—1057 using Service Library project templates altering configuration files using SvcConfigEditor.exe, 1059—1061 building simple math services, 1057—1058 testing with WcfTestClient.exe, 1058—1059 Visual Studio project templates, 1023— 1025 Windows control, 1292 1703 www.it-ebooks.info INDEX ■ Windows Explorer, viewing NET 4.0 GAC using, 566 Windows file header, 534—535 Windows Forms applications completing, 937 executing under Linux, 1580 extendable, 621—624 Windows Forms Client program, building, 1578—1580 Windows Forms database designer tools app.config files, 932 completing Windows Forms applications, 937 DataGridView control, 927—932 strongly typed data adapters, 936—937 strongly typed DataRows, 935 strongly typed DataSets, 932—934 strongly typed DataTables, 934 Windows Forms Graphics object, 1279 Windows Forms GUI toolkit, 903, 904, 906, 907, 913, 918, 920, 921, 927, 931 Windows Forms GUIs binding DataTable objects to DataView type, 912—913 deleting rows from DataTables, 907— 908 hydrating DataTables from generic List, 904—906 selecting rows based on filter criteria, 908—911 updating rows within DataTables, 911 data binding entities to, 986—989 Windows Forms message box, 540 Windows Forms, programming with building applications overview, 1513 populating controls collection, 1515—1517 System.EventArgs and System.EventHandler, 1517—1518 building complete applications adding infrastructure to MainWindow type, 1555 capturing and rendering graphical output, 1557 implementing serialization logic, 1558—1560 implementing Tools menu functionality, 1555—1556 main menu system, 1552—1553 overview, 1551 ShapeData type, 1553 ShapePickerDialog type, 1553—1555 designing dialog boxes configuring tab order, 1540 DialogResult property, 1539 displaying dialog boxes, 1542—1543 overview, 1538 setting form's default input button, 1541 Tab Order Wizard, 1540—1541 understanding form inheritance, 1543—1545 Form type Control class, 1526—1529 Form class, 1529—1530 life cycle, 1531—1533 overview, 1525 mouse and keyboard activity determining which button was clicked, 1535—1536 determining which key was pressed, 1536—1537 overview, 1534 namespaces, 1512—1513 overview, 1511 rendering graphical data using GDI+ Graphics type, 1548—1549 invalidating form's client area, 1551 obtaining Graphics object with Paint event, 1549—1550 overview, 1545—1546 System.Drawing namespace, 1547 Visual Studio Windows Forms project template initial Form, 1520—1521 overview, 1518 Program class, 1521—1522 1704 www.it-ebooks.info INDEX ■ visual designer surface, 1519—1520 visually building menu systems, 1522—1524 Windows Forms properties, 1392 Windows header information, 534 Windows help file, 269 Windows Management Instrumentation (WMI), 1043 Windows menu, 1363 Windows network identity, 1507 Windows Open dialog box, 621 Windows Presentation Foundation (WPF), 1285—1324, 1325—1375 animation Animation class types, 1304—1305 authoring in C# code, 1306—1307 authoring in XAML, 1309—1312 looping, 1308—1309 overview, 1303 pacing of, controlling, 1307—1308 To property, 1305 By property, 1305 From property, 1305 reversing, 1308—1309 Timeline Base class, 1305 control templates building custom with Visual Studio 2010, 1348—1355 default, 1341—1348 default, programmatically inspecting, 1344—1348 dependency properties building custom, 1331—1336 CLR property wrappers, 1330 examining existing, 1327—1330 overview, 1325 Jackpot Deluxe WPF application NET 4.0 visual states, 1366—1370 extracting UserControl from drawing geometry, 1365—1366 finalizing, 1371—1375 overview, 1364 logical trees overview, 1341 programmatically inspecting, 1342— 1343 resource system binary resources, 1285—1291 object (logical) resources, 1292—1303 routed events overview, 1337 routed bubbling events, 1338—1339 routed tunneling events, 1339—1341 styles animated, 1318 assigning programmatically, 1319— 1320 automatically applying with TargetType, 1314—1315 defining and applying, 1313—1314 defining with multiple triggers, 1317 defining with triggers, 1317 generating with Expression Blend, 1320—1324 overriding settings, 1314 overview, 1312 subclassing existing, 1315 unnamed, 1316 UserControls, building custom with Blend animation, defining, 1359—1362 initial C# code, 1359 overview, 1356 programmatically starting storyboard, 1363—1364 renaming initial, 1357—1358 SpinControl, 1358 visual trees overview, 1341—1342 programmatically inspecting, 1343— 1344 Windows Presentation Foundation (WPF) applications assemblies Application class, 1128—1130 overview, 1126—1127 Window class, 1130—1135 building using code-behind files 1705 www.it-ebooks.info INDEX ■ MainWindow class, adding code file for, 1165 MyApp class, adding code file for, 1166 processing files with msbuild.exe, 1166—1167 building using only XAML application object, defining, 1147 MainWindow class, defining, 1146— 1147 overview, 1144—1145 processing files with msbuild.exe, 1148—1150 building using Visual Studio 2010 Button Click event, implementing, 1175—1176 Closed event, implementing, 1177 designer tools, 1169—1172 GUI, designing, 1173—1174 Loaded event, implementing, 1174 overview, 1167 project templates, 1168 testing, 1177—1178 building without XAML application level data, interacting with, 1139—1140 closing window, 1141—1142 keyboard events, intercepting, 1143— 1144 mouse events, intercepting, 1142— 1143 overview, 1135—1136 strongly typed window, 1137—1138 user interface, 1138—1139 flavors of desktop applications, 1121—1123 navigation-based applications, 1124 WPF/Silverlight relationship, 1126 XBAP applications, 1124—1125 motivation behind optimized rendering model, 1120 overview, 1117 separation of concerns, 1119 simplifying UI programming, 1120— 1121 unifying APIs, 1118—1119 syntax of attached properties, 1162 class and member variable declarations, controlling, 1159 kaxaml, 1154—1156 kaxamlXAML XML namespaces and XAML, 1156—1159 markup extensions, 1163—1165 property-element syntax, 1161 XAML elements, XAML attributes and type converters, 1160—1161 transforming markup into NET assembly BAML, 1151—1152 mapping application data to C# code, 1153 mapping window data to C# code, 1150—1151 overview, 1150 XAML-to-assembly process, 1153— 1154 Windows Presentation Foundation (WPF) controls commands connecting to arbitrary actions, 1203—1204 connecting to Command property, 1202—1203 intrinsic control command objects, 1201 Open command, 1204—1206 overview, 1200 Save command, 1204—1206 core, 1179—1181 data-binding model Data Binding tab, 1236 DataContext property, 1239 DataGrid tab, 1242—1244 establishing data bindings, 1236— 1238, 1241—1242 IValueConverter interface, data conversion using, 1240—1241 overview, 1235 dialog boxes, 1183 1706 www.it-ebooks.info INDEX ■ document controls, 1183 Documents API block elements, 1227 document layout managers, 1228 inline elements, 1227 Documents tab, building annotations, enabling, 1232—1234 loading FlowDocument, 1234—1235 overview, 1228 populating FlowDocument, 1230— 1232 saving FlowDocument, 1234—1235 sticky notes, enabling, 1232—1234 Expression Blend, building user interface with key aspects of, 1207—1213 TabControl control, 1213—1215 Ink API tab, building ComboBox control, 1224—1226 InkCanvas control, 1222—1227 overview, 1216 RadioButton control, 1220—1222 ToolBar, 1217—1219 ink controls, 1182—1183 overview, 1179 panels enabling scrolling for, 1194—1195 nested, building window frame using, 1195—1200 overview, 1184—1185 positioning content within, 1186— 1194 using Visual Studio 2010, 1181—1182 Windows Presentation Foundation (WPF) graphics rendering services applying graphical transformations, 1262—1266 brushes configuring in code, 1260—1261 configuring using Visual Studio 2010, 1258—1260 generating complex vector graphics using expression design, 1275— 1276 options, 1246—1247 overview, 1245 pens, 1261—1262 rendering graphical data using drawings and geometries building DrawingBrush using geometries, 1272—1273 containing drawing types in DrawingImage, 1274—1275 overview, 1271 painting with DrawingBrush, 1273— 1274 rendering graphical data using visual layer DrawingVisual class, 1278—1279 rendering to custom layout manager, 1280—1282 responding to hit test operations, 1282—1284 visual base class and derived child classes, 1277 shapes adding rectangles, ellipses, and lines to canvas, 1249—1252 overview, 1247—1248 paths, 1254—1257 polylines and polygons, 1253—1254 removing rectangles, ellipses, and lines from canvas, 1252—1253 working with using Expression Blend, 1266—1271 Windows property, 1129, 1130 Windows services creating installer, 1064—1065 hosting services within creating Windows service installer, 1064—1065 enabling MEX, 1064 installing Windows service, 1066— 1067 overview, 1061 specifying ABCs in code, 1062—1063 installing, 1066—1067 Windows Start button, 1572 Windows Task Manager utility, 625 Windows thread scheduler, 728 1707 www.it-ebooks.info INDEX ■ Windows Workflow Foundation 4.0 (WF) activities collection, 1092—1093 control flow, 1089 error handling, 1092—1093 flowchart, 1089—1090 messaging, 1090—1091 overview, 1088 primitives, 1091 runtime, 1091 transaction, 1091—1092 business process, defining, 1078 overview, 1077 runtime engine WorkflowApplication class, hosting workflows using, 1086—1088 WorkflowInvoker class, hosting workflows using, 1083—1086 workflows consuming libraries, 1112—1114 flowchart, 1093—1103 isolating into dedicated libraries, 1103—1111 simple, 1079—1083 WindowsBase.dll assembly, 1127, 1135, 1157, 1168 WindowsFormsDataBinding application, 904 WindowsFormsDataBinding project, 904, 913 scope, 1297 WindowsStartupLocation attribute, 1146 WindowState property, 1530 WindowTop property, System.Console class, 82 window-wide resources, defining, 1292— 1294 WindowWidth property, System.Console class, 82 WinFormsClientApp.cs, 1578 WinFormsClientApp.rsp, 1579 Winnebago class, 611 WithCancellation( ) method, 771 WithCancellation( )method, 773 Wizard control, 1439, 1441, 1455 wizards, Workflow Activity Library project, 1083 Workflow Console Application project, 1083 workflow designer, defining arguments using, 1084—1086 Workflow Foundation (WF), 1024 Workflow node, 1103 Workflow Service Application project template, WCF, 1083 Workflow1.xaml file, 1081, 1084 WorkflowApplication class, hosting workflows using, 1086—1088 workflow-enabled applications, 30 WorkflowInvoker class, hosting workflows using defining arguments using workflow designer, 1084—1086 overview, 1083 passing arguments to workflow, 1084 WorkflowInvoker.Invoke( ) method, 1084, 1113 WorkflowLibraryClient project, 1112, 1114 WorkflowRuntime class, 1086 workflows consuming libraries, 1112—1114 flowchart activities, connecting in, 1094 FlowDecision activity, 1096—1098 ForEachT activity, 1099—1100 InvokeMethod activity, 1094—1095 overview, 1093 TerminateWorkflow activity, 1097 variables, workflow wide, 1095—1096 hosting using WorkflowApplication class, 1086—1088 hosting using WorkflowInvoker class defining arguments using workflow designer, 1084—1086 overview, 1083 passing arguments to workflows, 1084 isolating into dedicated libraries arguments, defining, 1105—1106 assemblies, importing, 1105 1708 www.it-ebooks.info INDEX ■ Assign activity, 1107 Code activity, 1109—1111 defining project, 1103—1104 If activity, 1107—1108 namespaces, importing, 1105 Switch activity, 1107—1108 variables, defining, 1106—1107 simple, 1079—1083 WorkflowServiceHost class, 1088 WorkWithArrayList( ) method, 367 World Wide Web (WWW) environment, 1473 World Wide Web Consortium (W3C), 995, 1019 WPF See Windows Presentation Foundation WPF Fundamentals node, 1336 WPF triggers, 1366 WPF User Control Library project, 1300 WpfAppAllCode namespace, 1137 WpfAppAllCode project, 1135, 1144 WpfAppAllXaml application, 1167 WpfAppAllXaml project, 1154 WpfAppCodeFiles folder, 1165 WpfAppCodeFiles project, 1167 WpfControlsAndAPIs application, 1207 WpfControlsAndAPIs project, 1244 WPFRoutedEvents project, 1337, 1341 WpfStyles application, 1313 WpfStyles project, 1320 WrapPanel panel control, WPF, 1186 WrapPanel panels, 1188, 1190 Write( ) method, 82, 793, 795, 800, 1421, 1422 WriteAllBytes( )method, 791 WriteAllLines( )method, 791 WriteAllText( )method, 791 WriteByte( ) member, 793 WriteFile( ) method, 1421 WriteLine activity, 1080, 1081, 1084, 1085, 1093, 1094, 1097, 1098, 1099, 1100 WriteLine( ) member, 795 WriteLine( ) method, 75, 82, 83, 181, 704 WriteXml( ) method, 889, 901 WriteXmlSchema( ) method, 901 writing, to text files, 795—796 WS-* (web service specifications), 1020 WS-* specifications, 1019 WS-Addressing (Web Services Addressing), 1029 WS-Basic (Web Services Basic), 1029 WSDL (Web Service Definition Language), 1019, 1021, 1034, 1044, 1055, 1072, 1073 wsdl link, 1055 wsdl utility, Mono, 1571 wsdl.exe file, 1018 wsdl.exe utility, Microsoft NET, 1571 WSDualHttpBinding class, 1029, 1030, 1031 WSDualHttpBinding option, 1029 element, 1029 WSE (Web Services Enhancements), 1019 WS-Federation (Web Services Federation), 1029 WSFederationHttpBinding class, 1029, 1031 WSFederationHttpBinding option, 1029 WSFederationHttpBinding protocol, 1030 element, 1029 WSHttpBinding class, 1029, 1063, 1070 WSHttpBinding option, 1029 WSHttpBinding protocol, 1029, 1058 element, 1029 WS-I (Web Services Interoperability Organization), 1019, 1029 WS-Reliability (Web Services Reliability), 1028 WS-SecureConversation (Web Services SecureConversation), 1030 WS-Security (Web Services Security), 1028, 1030 WS-Transactions (Web Services Transactions), 1028 WS-Trust (Web Services Trust), 1030 WWW (World Wide Web) environment, 1473 WYSIWYG (fixeddocuments), 1120 1709 www.it-ebooks.info INDEX ■ ■X x: Array keyword, 1163 x: ClassModifier keyword, 1158 X icon, 1142 x: Key keyword, 1158 x: Name keyword, 1158 x; prefix, 1157 X property, 211, 378, 1535 X string format character, 84 x: tag prefix, 1146 X value, 212 X1 property, 1250 X2 property, 1250 XAML NET 4.0 visual states, 1369—1370 authoring animation in discrete key frames, 1311—1312 event triggers, 1310—1311 overview, 1309 storyboards, 1310 exporting design document to, 1275— 1276 for simple workflows, 1081—1083 transforming markup into NET assembly, 1153—1154 WPF applications, building using application object, defining, 1147 MainWindow class, defining, 1146— 1147 overview, 1144—1145 processing files with msbuild.exe, 1148—1150 WPF applications, building without application level data, interacting with, 1139—1140 closing window, 1141—1142 keyboard events, intercepting, 1143— 1144 mouse events, intercepting, 1142— 1143 overview, 1135—1136 strongly typed window, 1137—1138 user interface, 1138—1139 WPF, syntax of attached properties, 1162 class and member variable declarations, controlling, 1159 kaxaml tool, 1154—1156 markup extensions, 1163—1165 overview, 1154 property-element syntax, 1161 type converters, 1160—1161 XAML, 1156—1159 XAML attributes, 1160—1161 XAML elements, 1160—1161 XAML XML namespaces, 1156—1159 XAML (Extensible Application Markup Language), 993 XAML (x:Name Extensible Application Markup Language) token, 1146 XAML attribute, 1160 XAML browser application (XBAP), 1124 XAML browser applications (XBAP applications), 1124—1125 XAML dialect, 1079 XAML editor, 1239, 1309, 1321, 1357 xaml file, 1298 *.xaml files, 1082, 1103, 1145, 1146, 1147, 1149, 1150, 1151, 1152, 1153 XAML files, external, 1082 XAML markup, 1152 XAML pane, 1155 XAML scope, 1316 XAML scrubber option, 1154 XAML string, 1347 XAML tab, 1369 XamlAnimations folder, 1309 XamlAnimations subdirectory, 1312 *.xaml.cs, 1165 XamlReader class, 1235 XamlReader type, 1173 XamlReader.Load( ) method, 1175 XamlSpecificStuff, 1157, 1158 XamlWriter class, 1235 XamlWriter type, 1173 x:Array keyword, 1158 x:Array markup extension, 1164 XAttribute class, 995, 998 XBAP (XAML browser application), 1124 1710 www.it-ebooks.info INDEX ■ XBAP applications (XAML browser applications), 1124—1125 XButton1 property, 1143 XButton1 value, 1536 XButton2 property, 1143 XButton2 value, 1536 XCData class, 998 x:Class attribute, 1104, 1150, 1156, 1159, 1357 x:Class keyword, 1158 x:Class value, 1104 x:ClassModifier attribute, 1159 x:Code attribute, 1159 x:Code keyword, 1158 element, 1147 XComment class, 998 XContainer class, 1000, 1001 x-coordinate, 1535 Xcopy deployment, 553 XDeclaration class, 998, 1003 XDocument class, 998, 1000, 1002, 1003, 1006, 1008, 1011 XDocument objects generating documents from arrays and containers, 1004—1005 loading and parsing XML content, 1006 overview, 1002 XDocuments class, 1004 XElement class, 995, 996, 999, 1000, 1003, 1004, 1006, 1011 XElement objects generating documents from arrays and containers, 1004—1005 loading and parsing XML content, 1006 overview, 1002 XElements class, 1004, 1005 x:FieldModifier attribute, 1159 XHTML (Extensible Hypertext Markup Language), 1383, 1392 x:Key attribute, 1293, 1315 x:Key value, 1293, 1316 XML (Extensible Markup Language), 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004 XML (Extensible Markup Language) schema editor, 902 XML APIs vs DOM models, 995—996 overview, 993—994 Visual Basic (VB) literal syntax, 996—997 XML content, loading and parsing, 1006 XML data, 815—816 XML documents building UI of LINQ to XML App, 1007 defining LINQ to XML Helper class, 1008—1009 importing Inventory.xml files, 1007— 1008 overview, 1006 rigging up UI to Helper class, 1009— 1011 XML Editor option, 968 XML markup, 1119 XML namespace (xmlns) attribute, 1383 XML namespaces, XAML, 1156—1159 XML Paper Specification (XPS), 1120, 1183, 1227 XML, serializing DataTable/DataSet objects as, 901—902 XML web services, 1016—1019 [XmlAttribute] attribute, 815 XML-based grammar, 1088 XmlDocument class, 995 XmlElement class, 995 [XmlElement] attribute, 815 [XmlEnum] attribute, 815 xmlns (XML namespace) attribute, 1383 [XmlnsDefinition] attribute, 1157 XmlReader class, 993 [XmlRoot] attribute, 815 XmlSerializer type, serializing objects using, 814—816 [XmlText] attribute, 815 [XmlType] attribute, 815 XmlWriter class, 993 x:Name attribute, 1150, 1156, 1159, 1275, 1276, 1293, 1357 XName class, 1001—1002 1711 www.it-ebooks.info INDEX ■ x:Name Extensible Application Markup Language (XAML) token, 1146 x:Name keyword, 1158 XName object, 1001 x:Name property, 1181 XNamespace class, 999, 1001—1002 XNode class, 999, 1000 x:Null keyword, 1158, 1163 xor opcode, 678 XPath (Extensible Markup Language Path Language), 993 XProcessingInstruction class, 999 XPS (XML Paper Specification), 1120, 1183, 1227 XQuery (Extensible Markup Language Query), 993 XSD (Extensible Markup Language Schema Definition) editor, 902 *.xsd file, 901, 902 xsd utility, Mono, 1571 xsd.exe utility, Microsoft NET, 1571 XSLT (Extensible Stylesheet Language Family Transformations), 993 XSP server, 1566 xsp2 utility, Mono, 1571 x:Static keyword, 1158, 1163 x:Static markup extension, 1163 XStreamingElement class, 999 x:Type keyword, 1158, 1163 x:Type markup extension, 1164 x:TypeArguments keyword, 1158 ■Y Y property, 211, 378, 1535 Y value, 212 Y1 property, 1250 Y2 property, 1250 y-coordinate, 1535 YesOrNo variable, 1095, 1097 yield keyword, building iterator methods with, 346 yield return statement, 346 yield return syntax, 346, 349 YourCars.dll assembly, 532 YourXaml.xaml file, 1174, 1175, 1176 Yugo value, 515 yugosOnlyView variable, 912 ■Z zero second mark, 1360 zero-code, 1452 zooming, 49 1712 www.it-ebooks.info www.it-ebooks.info .. .Pro C# 2010 and the NET Platform Fifth Edition ■■■ Andrew Troelsen www.it-ebooks.info Pro C# 2010 and the NET Platform, Fifth Edition Copyright © 2010 by Andrew Troelsen All... 43 9 Understanding Operator Overloading 44 4 Understanding Custom Type Conversions .45 4 Understanding Extension Methods 46 0 Understanding Partial Methods .47 0... 144 1 The Role of the Validation Controls 145 7 Working with Themes 146 5 Summary . 147 1 ■ Chapter 34: ASP.NET State Management Techniques . 147 3 The Issue

Ngày đăng: 06/03/2019, 13:59

Mục lục

  • Prelim

  • Contents at a Glance

  • Contents

  • About the Author

  • About the Technical Reviewer

  • Acknowledgments

  • Introduction

    • We’re a Team, You and I

    • An Overview of This Book

    • Obtaining This Book’s Source Code

    • Obtaining Updates for This Book

    • Contacting Me

  • Part 1: Introducing C# and the .NET Platform

    • The Philosophy of .NET

      • Understanding the Previous State of Affairs

        • Life As a C/Windows API Programmer

        • Life As a C++/MFC Programmer

        • Life As a Visual Basic 6.0 Programmer

        • Life As a Java Programmer

        • Life As a COM Programmer

        • The Complexity of COM Data Type Representation

      • The .NET Solution

      • Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS)

        • The Role of the Base Class Libraries

        • What C# Brings to the Table

      • Additional .NET-Aware Programming Languages

        • Life in a Multi-Language World

      • An Overview of .NET Assemblies

        • Single-File and Multi-File Assemblies

        • The Role of the Common Intermediate Language

        • Benefits of CIL

        • Compiling CIL to Platform-Specific Instructions

        • The Role of .NET Type Metadata

        • The Role of the Assembly Manifest

      • Understanding the Common Type System

        • CTS Class Types

        • CTS Interface Types

        • CTS Structure Types

        • CTS Enumeration Types

        • CTS Delegate Types

        • CTS Type Members

        • Intrinsic CTS Data Types

      • Understanding the Common Language Specification

        • Ensuring CLS Compliance

      • Understanding the Common Language Runtime

      • The Assembly/Namespace/Type Distinction

        • The Role of the Microsoft Root Namespace

        • Accessing a Namespace Programmatically

        • Referencing External Assemblies

      • Exploring an Assembly Using ildasm.exe

        • Viewing CIL Code

        • Viewing Type Metadata

        • Viewing Assembly Metadata (aka the Manifest)

      • Exploring an Assembly Using Reflector

      • Deploying the .NET Runtime

        • The .NET Client Profile Runtime

      • The Platform-Independent Nature of .NET

      • Summary

    • Building C# Applications

      • The Role of the .NET Framework 4.0 SDK

        • The Visual Studio 2010 Command Prompt

      • Building C# Applications Using csc.exe

        • Specifying Input and Output Targets

        • Referencing External Assemblies

        • Referencing Multiple External Assemblies

        • Compiling Multiple Source Files

        • Working with C# Response Files

        • The Default Response File (csc.rsp)

      • Building .NET Applications Using Notepad++

      • Building .NET Applications Using SharpDevelop

        • Building a Simple Test Project

      • Building .NET Applications Using Visual C# 2010 Express

        • Some Unique Features of Visual C# 2010 Express

      • Building .NET Applications Using Visual Studio 2010

        • Some Unique Features of Visual Studio 2010

        • Targeting the .NET Framework Using the New Project Dialog Box

        • Using the Solution Explorer Utility

        • Referencing External Assemblies

        • Viewing Project Properties

        • The Class View Utility

        • The Object Browser Utility

        • Integrated Support for Code Refactoring

        • Code Expansions and Surround With Technology

        • The Visual Class Designer

        • The Integrated .NET Framework 4.0 SDK Documentation System

      • Summary

  • Part 2: Core C# Programming Constructs

    • Core C# Programming Constructs, Part I

      • The Anatomy of a Simple C# Program

        • Variations on the Main() Method

        • Specifying an Application Error Code

        • Processing Command-Line Arguments

        • Specifying Command-Line Arguments with Visual Studio 2010

      • An Interesting Aside: Some Additional Members of the System.Environment Class

      • The System.Console Class

        • Basic Input and Output with the Console Class

        • Formatting Console Output

        • Formatting Numerical Data

        • Formatting Numerical Data Beyond Console Applications

      • System Data Types and C# Shorthand Notation

        • Variable Declaration and Initialization

        • Intrinsic Data Types and the new Operator

        • The Data Type Class Hierarchy

        • Members of Numerical Data Types

        • Members of System.Boolean

        • Members of System.Char

        • Parsing Values from String Data

        • System.DateTime and System.TimeSpan

        • The .NET 4.0 System.Numerics Namespace

      • Working with String Data

        • Basic String Manipulation

        • String Concatenation

        • Escape Characters

        • Defining Verbatim Strings

        • Strings and Equality

        • Strings Are Immutable

        • The System.Text.StringBuilder Type

      • Narrowing and Widening Data Type Conversions

        • Trapping Narrowing Data Conversions

        • Setting Project-wide Overflow Checking

        • The unchecked Keyword

        • The Role of System.Convert

      • Understanding Implicitly Typed Local Variables

        • Restrictions on Implicitly Typed Variables

        • Implicit Typed Data Is Strongly Typed Data

        • Usefulness of Implicitly Typed Local Variables

      • C# Iteration Constructs

        • The for Loop

        • The foreach Loop

        • Use of var Within foreach Constructs

        • The while and do/while Looping Constructs

      • Decision Constructs and the Relational/Equality Operators

        • The if/else Statement

        • The switch Statement

      • Summary

    • Core C# Programming Constructs, Part II

      • Methods and Parameter Modifiers

        • The Default Parameter-Passing Behavior

        • The out Modifier

        • The ref Modifier

        • The params Modifier

        • Defining Optional Parameters

        • Invoking Methods using Named Parameters

        • Understanding Method Overloading

      • Understanding C# Arrays

        • C# Array Initialization Syntax

        • Implicitly Typed Local Arrays

        • Defining an Array of Objects

        • Working with Multidimensional Arrays

        • Arrays As Arguments or Return Values

        • The System.Array Base Class

      • Understanding the Enum Type

        • Controlling the Underlying Storage for an Enum

        • Declaring Enum Variables

        • The System.Enum Type

        • Dynamically Discovering an Enum’s Name/Value Pairs

      • Understanding the Structure Type

        • Creating Structure Variables

      • Understanding Value Types and Reference Types

        • Value Types, References Types, and the Assignment Operator

        • Value Types Containing Reference Types

        • Passing Reference Types by Value

        • Passing Reference Types by Reference

        • Final Details Regarding Value Types and Reference Types

      • Understanding C# Nullable Types

        • Working with Nullable Types

        • The ?? Operator

      • Summary

    • Defining Encapsulated Class Types

      • Introducing the C# Class Type

        • Allocating Objects with the new Keyword

      • Understanding Constructors

        • The Role of the Default Constructor

        • Defining Custom Constructors

        • The Default Constructor Revisited

      • The Role of the this Keyword

        • Chaining Constructor Calls Using this

        • Observing Constructor Flow

        • Revisiting Optional Arguments

      • Understanding the static Keyword

        • Defining Static Methods

        • Defining Static Field Data

        • Defining Static Constructors

        • Defining Static Classes

      • Defining the Pillars of OOP

        • The Role of Encapsulation

        • The Role of Inheritance

        • The Role of Polymorphism

      • C# Access Modifiers

        • The Default Access Modifiers

        • Access Modifiers and Nested Types

      • The First Pillar: C#’s Encapsulation Services

        • Encapsulation Using Traditional Accessors and Mutators

        • Encapsulation Using .NET Properties

        • Using Properties within a Class Definition

        • Internal Representation of Properties

        • Controlling Visibility Levels of Property Get/Set Statements

        • Read-Only and Write-Only Properties

        • Static Properties

      • Understanding Automatic Properties

        • Interacting with Automatic Properties

        • Regarding Automatic Properties and Default Values

      • Understanding Object Initializer Syntax

        • Calling Custom Constructors with Initialization Syntax

        • Initializing Inner Types

      • Working with Constant Field Data

        • Understanding Read-Only Fields

        • Static Read-Only Fields

      • Understanding Partial Types

      • Summary

    • Understanding Inheritance and Polymorphism

      • The Basic Mechanics of Inheritance

        • Specifying the Parent Class of an Existing Class

        • Regarding Multiple Base Classes

        • The sealed Keyword

      • Revising Visual Studio Class Diagrams

      • The Second Pillar of OOP: The Details of Inheritance

        • Controlling Base Class Creation with the base Keyword

        • Keeping Family Secrets: The protected Keyword

        • Adding a Sealed Class

      • Programming for Containment/Delegation

        • Understanding Nested Type Definitions

      • The Third Pillar of OOP: C#’s Polymorphic Support

        • The virtual and override Keywords

        • Overriding Virtual Members Using Visual Studio 2010

        • Sealing Virtual Members

        • Understanding Abstract Classes

        • Understanding the Polymorphic Interface

        • Understanding Member Shadowing

      • Understanding Base Class/Derived Class Casting Rules

        • The C# as Keyword

        • The C# is Keyword

      • The Master Parent Class: System.Object

        • Overriding System.Object.ToString()

        • Overriding System.Object.Equals()

        • Overriding System.Object.GetHashCode()

        • Testing Your Modified Person Class

        • The Static Members of System.Object

      • Summary

    • Understanding Structured Exception Handling

      • Ode to Errors, Bugs, and Exceptions

      • The Role of .NET Exception Handling

        • The Atoms of .NET Exception Handling

        • The System.Exception Base Class

      • The Simplest Possible Example

        • Throwing a General Exception

        • Catching Exceptions

      • Configuring the State of an Exception

        • The TargetSite Property

        • The StackTrace Property

        • The HelpLink Property

        • The Data Property

      • System-Level Exceptions (System.SystemException)

      • Application-Level Exceptions (System.ApplicationException)

        • Building Custom Exceptions, Take One

        • Building Custom Exceptions, Take Two

        • Building Custom Exceptions, Take Three

      • Processing Multiple Exceptions

        • General catch Statements

        • Rethrowing Exceptions

        • Inner Exceptions

        • The Finally Block

      • Who Is Throwing What?

      • The Result of Unhandled Exceptions

      • Debugging Unhandled Exceptions Using Visual Studio

      • A Brief Word Regarding Corrupted State Exceptions (CSE)

      • Summary

    • Understanding Object Lifetime

      • Classes, Objects, and References

      • The Basics of Object Lifetime

        • The CIL of new

        • Setting Object References to null

      • The Role of Application Roots

      • Understanding Object Generations

      • Concurrent Garbage Collection under .NET 1.0 3.5

        • Background Garbage Collection under .NET 4.0

      • The System.GC Type

        • Forcing a Garbage Collection

      • Building Finalizable Objects

        • Overriding System.Object.Finalize()

        • Detailing the Finalization Process

      • Building Disposable Objects

        • Reusing the C# using Keyword

      • Building Finalizable and Disposable Types

        • A Formalized Disposal Pattern

      • Understanding Lazy Object Instantiation

        • Customizing the Creation of the Lazy Data

      • Summary

  • Part 3: Advanced C# Programming Constructs

    • Working with Interfaces

      • Understanding Interface Types

        • Interface Types vs. Abstract Base Classes

      • Defining Custom Interfaces

      • Implementing an Interface

      • Invoking Interface Members at the Object Level

        • Obtaining Interface References: The as Keyword

        • Obtaining Interface References: The is Keyword

      • Interfaces As Parameters

      • Interfaces As Return Values

      • Arrays of Interface Types

      • Implementing Interfaces Using Visual Studio 2010

      • Resolving Name Clashes via Explicit Interface Implementation

      • Designing Interface Hierarchies

        • Multiple Inheritance with Interface Types

      • Building Enumerable Types (IEnumerable and IEnumerator)

        • Building Iterator Methods with the yield Keyword

        • Building a Named Iterator

        • Internal Representation of an Iterator Method

      • Building Cloneable Objects (ICloneable)

        • A More Elaborate Cloning Example

      • Building Comparable Objects (IComparable)

        • Specifying Multiple Sort Orders (IComparer)

        • Custom Properties, Custom Sort Types

      • Summary

    • Understanding Generics

      • The Issues with Non-Generic Collections

        • The Issue of Performance

        • The Issue of Type Safety

      • The Role of Generic Type Parameters

        • Specifying Type Parameters for Generic Classes / Structures

        • Specifying Type Parameters for Generic Members

        • Specifying Type Parameters for Generic Interfaces

      • The System.Collections.Generic Namespace

        • Understanding Collection Initialization Syntax

        • Working with the List<T> Class

        • Working with the Stack<T> Class

        • Working with the Queue<T> Class

        • Working with the SortedSet<T> Class

      • Creating Custom Generic Methods

        • Inference of Type Parameters

      • Creating Custom Generic Structures and Classes

        • The default Keyword in Generic Code

        • Generic Base Classes

      • Constraining Type Parameters

        • Examples Using the where Keyword

        • The Lack of Operator Constraints

      • Summary

    • Delegates, Events, and Lambdas

      • Understanding the .NET Delegate Type

      • Defining a Delegate Type in C#

      • The System.MulticastDelegate and System.Delegate Base Classes

      • The Simplest Possible Delegate Example

        • Investigating a Delegate Object

      • Sending Object State Notifications using Delegates

        • Enabling Multicasting

        • Removing Targets from a Delegate’s Invocation List

      • Method Group Conversion Syntax

      • Understanding Delegate Covariance

      • Understanding Generic Delegates

        • Simulating Generic Delegates Without Generics

      • Understanding C# Events

        • The C# event Keyword

        • Events under the Hood

        • Listening to Incoming Events

        • Simplifying Event Registration Using Visual Studio 2010

        • Creating Custom Event Arguments

        • The Generic EventHandler<T> Delegate

      • Understanding C# Anonymous Methods

        • Accessing Local Variables

      • Understanding Lambda Expressions

        • Dissecting a Lambda Expression

        • Processing Arguments Within Multiple Statements

        • Lambda Expressions with Multiple (or Zero) Parameters

        • Retrofitting the CarEvents Example Using Lambda Expressions

      • Summary

    • Advanced C# Language Features

      • Understanding Indexer Methods

        • Indexing Data Using String Values

        • Overloading Indexer Methods

        • Indexers with Multiple Dimensions

        • Indexer Definitions on Interface Types

      • Understanding Operator Overloading

        • Overloading Binary Operators

        • And What of the += and –+ Operators?

        • Overloading Unary Operators

        • Overloading Equality Operators

        • Overloading Comparison Operators

        • The Internal Representation of Overloaded Operators

        • Final Thoughts Regarding Operator Overloading

      • Understanding Custom Type Conversions

        • Recall: Numerical Conversions

        • Recall: Conversions Among Related Class Types

        • Creating Custom Conversion Routines

        • Additional Explicit Conversions for the Square Type

        • Defining Implicit Conversion Routines

        • The Internal Representation of Custom Conversion Routines

        • Understanding Extension Methods

        • Defining Extension Methods

        • Invoking Extension Methods on an Instance Level

        • Invoking Extension Methods Statically

        • The Scope of an Extension Method

        • Importing Types That Define Extension Methods

        • The IntelliSense of Extension Methods

        • Building and Using Extension Libraries

        • Extending Interface Types via Extension Methods

        • Understanding Partial Methods

        • A First Look at Partial Methods

        • Uses of Partial Methods

        • Understanding Anonymous Types

        • The Internal Representation of Anonymous Types

        • The Implementation of ToString() and GetHashCode()

        • The Semantics of Equality for Anonymous Types

        • Anonymous Types Containing Anonymous Types

      • Working with Pointer Types

        • The unsafe Keyword

        • Working with the * and & Operators

        • An Unsafe (and Safe) Swap Function

        • Field Access via Pointers (the -> Operator)

        • The stackalloc Keyword

        • Pinning a Type via the fixed Keyword

        • The sizeof Keyword

      • Summary

    • LINQ to Objects

      • LINQ Specific Programming Constructs

        • Implicit Typing of Local Variables

        • Object and Collection Initialization Syntax

        • Lambda Expressions

        • Extension Methods

        • Anonymous Types

      • Understanding the Role of LINQ

        • LINQ Expressions Are Strongly Typed

        • The Core LINQ Assemblies

      • Applying LINQ Queries to Primitive Arrays

        • Once Again, Without LINQ

        • Reflecting Over a LINQ Result Set

        • LINQ and Implicitly Typed Local Variables

        • LINQ and Extension Methods

        • The Role of Deferred Execution

        • The Role of Immediate Execution

      • Returning the Result of a LINQ Query

        • Returning LINQ Results via Immediate Execution

      • Applying LINQ Queries to Collection Objects

        • Accessing Contained Subobjects

        • Applying LINQ Queries to Nongeneric Collections

        • Filtering Data Using OfType<T>()

      • Investigating the C# LINQ Query Operators

        • Basic Selection Syntax

        • Obtaining Subsets of Data

        • Projecting New Data Types

        • Obtaining Counts Using Enumerable

        • Reversing Result Sets

        • Sorting Expressions

        • LINQ As a Better Venn Diagramming Tool

        • Removing Duplicates

        • LINQ Aggregation Operations

      • The Internal Representation of LINQ Query Statements

        • Building Query Expressions with Query Operators (Revisited)

        • Building Query Expressions Using the Enumerable Type and Lambda Expressions

        • Building Query Expressions Using the Enumerable Type and Anonymous Methods

        • Building Query Expressions Using the Enumerable Type and Raw Delegates

      • Summary

  • Part 4: Programming with .NET Assemblies

    • Configuring .NET Assemblies

      • Defining Custom Namespaces

        • Resolving Name Clashes with Fully Qualified Names

        • Resolving Name Clashes with Aliases

        • Creating Nested Namespaces

        • The Default Namespace of Visual Studio 2010

      • The Role of .NET Assemblies

        • Assemblies Promote Code Reuse

        • Assemblies Establish a Type Boundary

        • Assemblies Are Versionable Units

        • Assemblies Are Self-Describing

        • Assemblies Are Configurable

      • Understanding the Format of a .NET Assembly

        • The Windows File Header

        • The CLR File Header

        • CIL Code, Type Metadata, and the Assembly Manifest

        • Optional Assembly Resources

        • Single-File and Multifile Assemblies

      • Building and Consuming a Single-File Assembly

        • Exploring the Manifest

        • Exploring the CIL

        • Exploring the Type Metadata

        • Building a C# Client Application

        • Building a Visual Basic Client Application

        • Cross-Language Inheritance in Action

      • Building and Consuming a Multifile Assembly

        • Exploring the ufo.netmodule File

        • Exploring the airvehicles.dll File

        • Consuming a Multifile Assembly

      • Understanding Private Assemblies

        • The Identity of a Private Assembly

        • Understanding the Probing Process

        • Configuring Private Assemblies

        • Configuration Files and Visual Studio 2010

      • Understanding Shared Assemblies

        • Understanding Strong Names

        • Generating Strong Names at the Command Line

        • Generating Strong Names using Visual Studio 2010

        • Installing Strongly Named Assemblies to the GAC

        • Viewing the .NET 4.0 GAC using Windows Explorer

      • Consuming a Shared Assembly

        • Exploring the Manifest of SharedCarLibClient

      • Configuring Shared Assemblies

        • Freezing the Current Shared Assembly

        • Building Shared Assembly Version 2.0.0.0

        • Dynamically Redirecting to Specific Versions of a Shared Assembly

      • Understanding Publisher Policy Assemblies

        • Disabling Publisher Policy

      • Understanding the <codeBase> Element

      • The System.Configuration Namespace

      • Summary

    • Type Reflection, Late Binding, and Attribute-Based Programming

      • The Necessity of Type Metadata

        • Viewing (Partial) Metadata for the EngineState Enumeration

        • Viewing (Partial) Metadata for the Car Type

        • Examining a TypeRef

        • Documenting the Defining Assembly

        • Documenting Referenced Assemblies

        • Documenting String Literals

      • Understanding Reflection

        • The System.Type Class

        • Obtaining a Type Reference Using System.Object.GetType()

        • Obtaining a Type Reference Using typeof()

        • Obtaining a Type Reference Using System.Type.GetType()

      • Building a Custom Metadata Viewer

        • Reflecting on Methods

        • Reflecting on Fields and Properties

        • Reflecting on Implemented Interfaces

        • Displaying Various Odds and Ends

        • Implementing Main()

        • Reflecting on Generic Types

        • Reflecting on Method Parameters and Return Values

      • Dynamically Loading Assemblies

      • Reflecting on Shared Assemblies

      • Understanding Late Binding

        • The System.Activator Class

        • Invoking Methods with No Parameters

        • Invoking Methods with Parameters

      • Understanding the Role of .NET Attributes

        • Attribute Consumers

        • Applying Attributes in C#

        • C# Attribute Shorthand Notation

        • Specifying Constructor Parameters for Attributes

        • The Obsolete Attribute in Action

      • Building Custom Attributes

        • Applying Custom Attributes

        • Named Property Syntax

        • Restricting Attribute Usage

      • Assembly-Level (and Module-Level) Attributes

        • The Visual Studio 2010 AssemblyInfo.cs File

      • Reflecting on Attributes Using Early Binding

      • Reflecting on Attributes Using Late Binding

      • Putting Reflection, Late Binding, and Custom Attributes in Perspective

      • Building an Extendable Application

        • Building CommonSnappableTypes.dll

        • Building the C# Snap-In

        • Building the Visual Basic Snap-In

        • Building an Extendable Windows Forms Application

      • Summary

    • Processes, AppDomains, and Object Contexts

      • The Role of a Windows Process

        • The Role of Threads

      • Interacting with Processes Under the .NET Platform

        • Enumerating Running Processes

        • Investigating a Specific Process

        • Investigating a Process’s Thread Set

        • Investigating a Process’s Module Set

        • Starting and Stopping Processes Programmatically

        • Controlling Process Startup using the ProcessStartInfo Class

      • Understanding .NET Application Domains

        • The System.AppDomain Class

      • Interacting with the Default Application Domain

        • Enumerating Loaded Assemblies

        • Receiving Assembly Load Notifications

      • Creating New Application Domains

        • Loading Assemblies into Custom Application Domains

        • Programmatically Unloading AppDomains

      • Understanding Object Context Boundaries

        • Context-Agile and Context-Bound Types

        • Defining a Context-Bound Object

        • Inspecting an Object’s Context

      • Summarizing Processes, AppDomains, and Context

      • Summary

    • Understanding CIL and the Role of Dynamic Assemblies

      • Reasons for Learning the Grammar of CIL

      • Examining CIL Directives, Attributes, and Opcodes

        • The Role of CIL Directives

        • The Role of CIL Attributes

        • The Role of CIL Opcodes

        • The CIL Opcode/CIL Mnemonic Distinction

      • Pushing and Popping: The Stack-Based Nature of CIL

      • Understanding Round-Trip Engineering

        • The Role of CIL Code Labels

        • Interacting with CIL: Modifying an *.il File

        • Compiling CIL Code Using ilasm.exe

        • Authoring CIL Code Using SharpDevelop

        • The Role of peverify.exe

      • Understanding CIL Directives and Attributes

        • Specifying Externally Referenced Assemblies in CIL

        • Defining the Current Assembly in CIL

        • Defining Namespaces in CIL

        • Defining Class Types in CIL

        • Defining and Implementing Interfaces in CIL

        • Defining Structures in CIL

        • Defining Enums in CIL

        • Defining Generics in CIL

        • Compiling the CILTypes.il file

      • .NET Base Class Library, C#, and CIL Data Type Mappings

      • Defining Type Members in CIL

        • Defining Field Data in CIL

        • Defining Type Constructors in CIL

        • Defining Properties in CIL

        • Defining Member Parameters

      • Examining CIL Opcodes

        • The .maxstack Directive

        • Declaring Local Variables in CIL

        • Mapping Parameters to Local Variables in CIL

        • The Hidden this Reference

        • Representing Iteration Constructs in CIL

      • Building a .NET Assembly with CIL

        • Building CILCars.dll

        • Building CILCarClient.exe

      • Understanding Dynamic Assemblies

        • Exploring the System.Reflection.Emit Namespace

        • The Role of the System.Reflection.Emit.ILGenerator

        • Emitting a Dynamic Assembly

        • Emitting the Assembly and Module Set

        • The Role of the ModuleBuilder Type

        • Emitting the HelloClass Type and the String Member Variable

        • Emitting the Constructors

        • Emitting the SayHello() Method

        • Using the Dynamically Generated Assembly

      • Summary

    • Dynamic Types and the Dynamic Language Runtime

      • The Role of the C# dynamic Keyword

        • Calling Members on Dynamically Declared Data

        • The Role of the Microsoft.CSharp.dll Assembly

        • The Scope of the dynamic keyword

        • Limitations of the dynamic Keyword

        • Practical Uses of the dynamic Keyword

      • The Role of the Dynamic Language Runtime (DLR)

        • The Role of Expression Trees

        • The Role of the System.Dynamic Namespace

        • Dynamic Runtime Lookup of Expression Trees

      • Simplifying Late Bound Calls Using Dynamic Types

        • Leveraging the dynamic Keyword to Pass Arguments

      • Simplifying COM Interoperability using Dynamic Data

        • The Role of Primary Interop Assemblies (PIAs)

        • Embedding Interop Metadata

        • Common COM Interop Pain Points

      • COM Interop using C# 4.0 Language Features

        • COM interop without C# 4.0 Language Features

      • Summary

  • Part 5: Introducing the .NET Base Class Libraries

    • Multithreaded and Parallel Programming

      • The Process/AppDomain/Context/Thread Relationship

        • The Problem of Concurrency

        • The Role of Thread Synchronization

      • A Brief Review of the .NET Delegate

      • The Asynchronous Nature of Delegates

        • The BeginInvoke() and EndInvoke() Methods

        • The System.IAsyncResult Interface

      • Invoking a Method Asynchronously

        • Synchronizing the Calling Thread

        • The Role of the AsyncCallback Delegate

        • The Role of the AsyncResult Class

        • Passing and Receiving Custom State Data

      • The System.Threading Namespace

      • The System.Threading.Thread Class

        • Obtaining Statistics About the Current Thread

        • The Name Property

        • The Priority Property

      • Programmatically Creating Secondary Threads

        • Working with the ThreadStart Delegate

        • Working with the ParameterizedThreadStart Delegate

        • The AutoResetEvent Class

        • Foreground Threads and Background Threads

      • The Issue of Concurrency

        • Synchronization Using the C# lock Keyword

        • Synchronization Using the System.Threading.Monitor Type

        • Synchronization Using the System.Threading.Interlocked Type

        • Synchronization Using the [Synchronization] Attribute

      • Programming with Timer Callbacks

      • Understanding the CLR ThreadPool

      • Parallel Programming under the .NET Platform

        • The Task Parallel Library API

        • The Role of the Parallel Class

        • Understanding Data Parallelism

        • The Task Class

        • Handling Cancelation Request

        • Understanding Task Parallelism

      • Parallel LINQ Queries (PLINQ)

        • Opting in to a PLINQ Query

        • Canceling a PLINQ Query

      • Summary

    • File I/O and Object Serialization

      • Exploring the System.IO Namespace

      • The Directory(Info) and File(Info) Types

        • The Abstract FileSystemInfo Base Class

      • Working with the DirectoryInfo Type

        • Enumerating Files with the DirectoryInfo Type

        • Creating Subdirectories with the DirectoryInfo Type

      • Working with the Directory Type

      • Working with the DriveInfo Class Type

      • Working with the FileInfo Class

        • The FileInfo.Create() Method

        • The FileInfo.Open() Method

        • The FileInfo.OpenRead() and FileInfo.OpenWrite() Methods

        • The FileInfo.OpenText() Method

        • The FileInfo.CreateText() and FileInfo.AppendText() Methods

      • Working with the File Type

        • Additional File-centric Members

      • The Abstract Stream Class

        • Working with FileStreams

      • Working with StreamWriters and StreamReaders

        • Writing to a Text File

        • Reading from a Text File

        • Directly Creating StreamWriter/StreamReader Types

      • Working with StringWriters and StringReaders

      • Working with BinaryWriters and BinaryReaders

      • Watching Files Programmatically

      • Understanding Object Serialization

        • The Role of Object Graphs

      • Configuring Objects for Serialization

        • Defining Serializable Types

        • Public Fields, Private Fields, and Public Properties

      • Choosing a Serialization Formatter

        • The IFormatter and IRemotingFormatter Interfaces

        • Type Fidelity Among the Formatters

      • Serializing Objects Using the BinaryFormatter

        • Deserializing Objects Using the BinaryFormatter

      • Serializing Objects Using the SoapFormatter

      • Serializing Objects Using the XmlSerializer

        • Controlling the Generated XML Data

      • Serializing Collections of Objects

      • Customizing the Soap/Binary Serialization Process

        • A Deeper Look at Object Serialization

        • Customizing Serialization Using ISerializable

        • Customizing Serialization Using Attributes

      • Summary

    • ADO.NET Part I: The Connected Layer

      • A High-Level Definition of ADO.NET

        • The Three Faces of ADO.NET

      • Understanding ADO.NET Data Providers

        • The Microsoft-Supplied ADO.NET Data Providers

        • A Word Regarding System.Data.OracleClient.dll

        • Obtaining Third-Party ADO.NET Data Providers

      • Additional ADO.NET Namespaces

      • The Types of the System.Data Namespace

        • The Role of the IDbConnection Interface

        • The Role of the IDbTransaction Interface

        • The Role of the IDbCommand Interface

        • The Role of the IDbDataParameter and IDataParameter Interfaces

        • The Role of the IDbDataAdapter and IDataAdapter Interfaces

        • The Role of the IDataReader and IDataRecord Interfaces

      • Abstracting Data Providers Using Interfaces

        • Increasing Flexibility Using Application Configuration Files

      • Creating the AutoLot Database

        • Creating the Inventory Table

        • Authoring the GetPetName() Stored Procedure

        • Creating the Customers and Orders Tables

        • Visually Creating Table Relationships

      • The ADO.NET Data Provider Factory Model

        • A Complete Data Provider Factory Example

        • A Potential Drawback with the Provide Factory Model

        • The <connectionStrings> Element

      • Understanding the Connected Layer of ADO.NET

        • Working with Connection Objects

        • Working with ConnectionStringBuilder Objects

        • Working with Command Objects

      • Working with Data Readers

        • Obtaining Multiple Result Sets Using a Data Reader

      • Building a Reusable Data Access Library

        • Adding the Connection Logic

        • Adding the Insertion Logic

        • Adding the Deletion Logic

        • Adding the Update Logic

        • Adding the Selection Logic

        • Working with Parameterized Command Objects

        • Specifying Parameters Using the DbParameter Type

        • Executing a Stored Procedure

      • Creating a Console UI–Based Front End

        • Implementing the Main() Method

        • Implementing the ShowInstructions() Method

        • Implementing the ListInventory() Method

        • Implementing the DeleteCar() Method

        • Implementing the InsertNewCar() Method

        • Implementing the UpdateCarPetName() Method

        • Implementing LookUpPetName()

      • Understanding Database Transactions

        • Key Members of an ADO.NET Transaction Object

        • Adding a CreditRisks Table to the AutoLot Database

        • Adding a Transaction Method to InventoryDAL

        • Testing Your Database Transaction

      • Summary

    • ADO.NET Part II: The Disconnected Layer

      • Understanding the Disconnected Layer of ADO.NET

      • Understanding the Role of the DataSet

        • Key Properties of the DataSet

        • Key Methods of the DataSet

        • Building a DataSet

      • Working with DataColumns

        • Building a DataColumn

        • Enabling Autoincrementing Fields

        • Adding DataColumn Objects to a DataTable

      • Working with DataRows

        • Understanding the RowState Property

        • Understanding the DataRowVersion Property

      • Working with DataTables

        • Inserting DataTables into DataSets

        • Obtaining Data in a DataSet

        • Processing DataTable Data Using DataTableReader Objects

        • Serializing DataTable/DataSet Objects As XML

        • Serializing DataTable/DataSet Objects in a Binary Format

      • Binding DataTable Objects to Windows Forms GUIs

        • Hydrating a DataTable from a Generic List<T>

        • Deleting Rows from a DataTable

        • Selecting Rows Based on Filter Criteria

        • Updating Rows Within a DataTable

        • Working with the DataView Type

      • Working with Data Adapters

        • A Simple Data Adapter Example

        • Mapping Database Names to Friendly Names

      • Adding Disconnection Functionality to AutoLotDAL.dll

        • Defining the Initial Class Type

        • Configuring the Data Adapter Using the SqlCommandBuilder

        • Implementing GetAllInventory()

        • Implementing UpdateInventory()

        • Setting Your Version Number

        • Testing the Disconnected Functionality

      • Multitabled DataSet Objects and Data Relationships

        • Prepping the Data Adapters

        • Building the Table Relationships

        • Updating the Database Tables

        • Navigating Between Related Tables

      • The Windows Forms Database Designer Tools

        • Visually Designing the DataGridView

        • The Generated app.config File

        • Examining the Strongly Typed DataSet

        • Examining the Strongly Typed DataTable

        • Examining the Strongly Typed DataRow

        • Examining the Strongly Typed Data Adapter

        • Completing the Windows Forms Application

      • Isolating Strongly Typed Database Code into a Class Library

        • Viewing the Generated Code

        • Selecting Data with the Generated Code

        • Inserting Data with the Generated Code

        • Deleting Data with the Generated Code

        • Invoking a Stored Procedure using the Generated Code

      • Programming with LINQ to DataSet

        • The Role of the DataSet Extensions Library

        • Obtaining a LINQ-Compatible DataTable

        • The Role of the DataRowExtensions.Field<T>() Extension Method

        • Hydrating New DataTables from LINQ Queries

      • Summary

    • ADO.NET Part III: The Entity Framework

      • Understanding the Role of Entity Framework

        • The Role of Entities

        • The Building Blocks of the Entity Framework

        • The Role of Object Services

        • The Role of the Entity Client

        • The Role of the *.edmx File (and Friends)

        • The Role of the ObjectContext and ObjectSet<T> Classes

        • All Together Now!

      • Building and Analyzing your First EDM

        • Generating the *.edmx File

        • Reshaping the Entity Data

        • Viewing the Mappings

        • Viewing the Generated *.edmx File Data

        • Viewing the Generated Source Code

        • Enhancing the Generated Source Code

      • Programming Against the Conceptual Model

        • Deleting a Record

        • Updating a Record

        • Querying with LINQ to Entities

        • Querying with Entity SQL

        • Working with the Entity Client Data Reader Object

      • AutoLotDAL Version 4.0, Now with Entities

        • Mapping the Stored Procedure

        • The Role of Navigation Properties

        • Using Navigation Properties within LINQ to Entity Queries

        • Invoking a Stored Procedure

      • Data Binding Entities to Windows Forms GUIs

        • Adding the Data Binding Code

      • Summary

    • Introducing LINQ to XML

      • A Tale of Two XML APIs

        • LINQ to XML As a Better DOM

        • VB Literal Syntax As a Better LINQ to XML

      • Members of the System.Xml.Linq Namespace

        • The LINQ to XML Axis Methods

        • The Oddness of XName (and XNamespace)

      • Working with XElement and XDocument

        • Generating Documents from Arrays and Containers

        • Loading and Parsing XML Content

      • Manipulating an in Memory XML Document

        • Building the UI of the LINQ to XML App

        • Import the Inventory.xml File

        • Defining a LINQ to XML Helper Class

        • Rigging up the UI to Your Helper Class

      • Summary

    • Introducing Windows Communication Foundation

      • A Potpourri of Distributed Computing APIs

        • The Role of DCOM

        • The Role of COM+/Enterprise Services

        • The Role of MSMQ

        • The Role of .NET Remoting

        • The Role of XML Web Services

        • A .NET Web Service Example

        • Web Service Standards

        • Named Pipes, Sockets, and P2P

      • The Role of WCF

        • An Overview of WCF Features

        • An Overview of Service-Oriented Architecture

        • Tenet 1: Boundaries Are Explicit

        • Tenet 2: Services Are Autonomous

        • Tenet 3: Services Communicate via Contract, Not Implementation

        • Tenet 4: Service Compatibility Is Based on Policy

        • WCF: The Bottom Line

      • Investigating the Core WCF Assemblies

      • The Visual Studio WCF Project Templates

        • The WCF Service Website Project Template

      • The Basic Composition of a WCF Application

      • The ABCs of WCF

        • Understanding WCF Contracts

        • Understanding WCF Bindings

        • HTTP-Based Bindings

        • TCP-Based Bindings

        • MSMQ-Based Bindings

        • Understanding WCF Addresses

      • Building a WCF Service

        • The [ServiceContract] Attribute

        • The [OperationContract] Attribute

        • Service Types As Operational Contracts

      • Hosting the WCF Service

        • Establishing the ABCs Within an App.config File

        • Coding Against the ServiceHost Type

        • Specifying Base Addresses

        • Details of the ServiceHost Type

        • Details of the <system.serviceModel> Element

        • Enabling Metadata Exchange

      • Building the WCF Client Application

        • Generating Proxy Code Using svcutil.exe

        • Generating Proxy Code Using Visual Studio 2010

        • Configuring a TCP-Based Binding

      • Simplifying Configuration Settings with WCF 4.0

        • Default Endpoints in WCF 4.0

        • Exposing a Single WCF Service Using Multiple Bindings

        • Changing Settings for a WCF Binding

        • The WCF 4.0 Default MEX Behavior Configuration

        • Refreshing the Client Proxy and Selecting the Binding

      • Using the WCF Service Library Project Template

        • Building a Simple Math Service

        • Testing the WCF Service with WcfTestClient.exe

        • Altering Configuration Files Using SvcConfigEditor.exe

      • Hosting the WCF Service within a Windows Service

        • Specifying the ABCs in Code

        • Enabling MEX

        • Creating a Windows Service Installer

        • Installing the Windows Service

      • Invoking a Service Asynchronously from the Client

      • Designing WCF Data Contracts

        • Using the Web-Centric WCF Service Project Template

        • Implementing the Service Contract

        • The Role of the *.svc File

        • Examining the Web.config File

        • Testing the Service

      • Summary

    • Introducing Windows Workflow Foundation 4.0

      • Defining a Business Process

        • The Role of WF 4.0

      • Building a (Painfully) Simple Workflow

        • Viewing the Underlying XAML

      • The WF 4.0 Runtime

        • Hosting a Workflow using WorkflowInvoker

        • Passing Arguments to your Workflow using WorkflowInvoker

        • Defining Arguments using the Workflow Designer

        • Hosting a Workflow using WorkflowApplication

        • Recap of your First Workflow

      • Examining the Workflow 4.0 Activities

        • Control Flow Activities

        • Flowchart Activities

        • Messaging Activities

        • The Runtime and Primitives Activities

        • The Transaction Activities

        • The Collection and Error Handling Activities

      • Building a Flowchart Workflow

        • Connecting Activities in a Flowchart

        • Working with the InvokeMethod Activity

        • Defining Workflow Wide Variables

        • Working with the FlowDecision Activity

        • Working with the TerminateWorkflow Activity

        • Building the “True” Condition

        • Working with the ForEach<T> Activity

        • Completing the Application

        • Reflecting on What We Have Done

      • Isolating Workflows into Dedicated Libraries

        • Defining the Initial Project

        • Importing Assemblies and Namespaces

        • Defining the Workflow Arguments

        • Defining Workflow Variables

        • Working with the Assign Activity

        • Working with the If and Switch Activities

        • Building a Custom Code Activity

      • Consuming the Workflow Library

        • Retrieving the Workflow Output Argument

      • Summary

  • Part 6: Building Desktop User Interfaces with WPF

    • Introducing Windows Presentation Foundation and XAML

      • The Motivation Behind WPF

        • Unifying Diverse APIs

        • Providing a Separation of Concerns via XAML

        • Providing an Optimized Rendering Model

        • Simplifying Complex UI Programming

      • The Various Flavors of WPF

        • Traditional Desktop Applications

        • Navigation-Based WPF Applications

        • XBAP Applications

        • The WPF/Silverlight Relationship

      • Investigating the WPF Assemblies

        • The Role of the Application Class

        • Constructing an Application Class

        • Enumerating the Application.Windows collection

        • The Role of the Window Class

        • The Role of System.Windows.Controls.ContentControl

        • The Role of System.Windows.Controls.Control

        • The Role of System.Windows.FrameworkElement

        • The Role of System.Windows.UIElement

        • The Role of System.Windows.Media.Visual

        • The Role of System.Windows.DependencyObject

        • The Role of System.Windows.Threading.DispatcherObject

      • Building a WPF Application without XAML

        • Creating a Strongly Typed Window

        • Creating a Simple User Interface

        • Interacting with Application Level Data

        • Handling the Closing of a Window Object

        • Intercepting Mouse Events

        • Intercepting Keyboard Events

      • Building a WPF Application using Only XAML

        • Defining MainWindow in XAML

        • Defining the Application Object in XAML

        • Processing the XAML Files using msbuild.exe

      • Transforming Markup into a .NET Assembly

        • Mapping the Window XAML Data to C# Code

        • The Role of BAML

        • Mapping the Application XAML Data to C# Code

        • XAML-to-Assembly Process Summary

      • Understanding The Syntax of WPF XAML

        • Introducing Kaxaml

        • XAML XML Namespaces and XAML "Keywords"

        • Controlling Class and Member Variable Declarations

        • XAML Elements, XAML Attributes and Type Converters

        • Understanding XAML Property-Element Syntax

        • Understanding XAML Attached Properties

        • Understanding XAML Markup Extensions

      • Building a WPF Application using Code-Behind Files

        • Adding a Code File for the MainWindow Class

        • Adding a Code File for the MyApp Class

        • Processing the Code Files with msbuild.exe

      • Building WPF Applications Using Visual Studio 2010

        • The WPF Project Templates

        • Exploring the WPF Designer Tools

        • Designing the GUI of our Window

        • Implementing the Loaded Event

        • Implementing the Button’s Click Event

        • Implementing the Closed Event

        • Testing the Application

      • Summary

    • Programming with WPF Controls

      • A Survey of the Core WPF Controls

        • Working with WPF Controls Using Visual Studio 2010

        • The WPF Ink Controls

        • The WPF Document Controls

        • WPF Common Dialog Boxes

        • The Details Are in the Documentation

      • Controlling Content Layout Using Panels

        • Positioning Content Within Canvas Panels

        • Positioning Content Within WrapPanel Panels

        • Positioning Content Within StackPanel Panels

        • Positioning Content Within Grid Panels

        • Grids with GridSplitter Types

        • Positioning Content Within DockPanel Panels

        • Enabling Scrolling for Panel Types

      • Building a Window’s Frame Using Nested Panels

        • Building the Menu System

        • Building the ToolBar

        • Building the StatusBar

        • Finalizing the UI Design

        • Implementing the MouseEnter/MouseLeave Event Handlers

        • Implementing the Spell Checking Logic

      • Understanding WPF Control Commands

        • The Intrinsic Control Command Objects

        • Connecting Commands to the Command Property

        • Connecting Commands to Arbitrary Actions

        • Working with the Open and Save Commands

      • Building a WPF User Interface with Expression Blend

        • Getting to know the Key Aspects of the Blend IDE

        • Using the TabControl

      • Building the Ink API Tab

        • Designing the ToolBar

        • The RadioButton Control

        • The InkCanvas Control

        • The ComboBox Control

        • Saving, Loading, and Clearing InkCanvas Data

      • Introducing the Documents API

        • Block Elements and Inline Elements

        • Document Layout Managers

      • Building the Documents Tab

        • Populating a FlowDocument using Blend

        • Populating a FlowDocument Using Code

        • Enabling Annotations and Sticky Notes

        • Saving and Loading a Flow Document

      • Introducing the WPF Data-Binding Model

        • Building the Data Binding Tab

        • Establishing Data Bindings using Blend

        • The DataContext Property

        • Data Conversion Using IValueConverter

        • Establishing Data Bindings in Code

        • Building the DataGrid Tab

      • Summary

    • WPF Graphics Rendering Services

      • Understanding WPF's Graphical Rendering Services

        • WPF Graphical Rendering Options

      • Rendering Graphical Data Using Shapes

        • Adding Rectangles, Ellipses, and Lines to a Canvas

        • Removing Rectangles, Ellipses, and Lines from a Canvas

        • Working with Polylines and Polygons

        • Working with Paths

        • The Path "Modeling Mini Language"

      • WPF Brushes and Pens

        • Configuring Brushes Using Visual Studio 2010

        • Configuring Brushes in Code

        • Configuring Pens

      • Applying Graphical Transformations

        • A First Look at Transformations

        • Transforming our Canvas Data

      • Working with Shapes using Expression Blend

        • Selecting a Shape to Render from the Tool Palette

        • Converting Shapes to Paths

        • Combining Shapes

        • The Brush and Transformation Editors

      • Rendering Graphical Data Using Drawings and Geometries

        • Building a DrawingBrush using Geometries

        • Painting with the DrawingBrush

        • Containing Drawing Types in a DrawingImage

      • Generating Complex Vector Graphics using Expression Design

        • Exporting a Design Document to XAML

      • Rendering Graphical Data Using the Visual Layer

        • The Visual Base Class and Derived Child Classes

        • A First Look at using the DrawingVisual Class

        • Rendering Visual Data to a Custom Layout Manager

        • Responding to Hit Test Operations

      • Summary

    • WPF Resources, Animations, and Styles

      • Understanding the WPF Resource System

        • Working with Binary Resources

        • Including Loose Resource Files in a Project

        • Configuring the Loose Resources

        • Programmatically Loading an Image

        • Embedding Application Resources

      • Working with Object (Logical) Resources

        • The Role of the Resources Property

        • Defining Window-Wide Resources

        • The {StaticResource} Markup Extension

        • Changing a Resource after Extraction

        • The {DynamicResource} Markup Extension

        • Application-Level Resources

        • Defining Merged Resource Dictionaries

        • Defining a Resource-Only Assembly

        • Extracting Resources in Expression Blend

      • Understanding WPF’s Animation Services

        • The Role of the Animation Class Types

        • The To, From, and By Properties

        • The Role of the Timeline Base Class

        • Authoring an Animation in C# Code

        • Controlling the Pacing of an Animation

        • Reversing and Looping an Animation

      • Authoring Animations in XAML

        • The Role of Storyboards

        • The Role of Event Triggers

        • Animation Using Discrete Key Frames

      • Understanding the Role of WPF Styles

        • Defining and Applying a Style

        • Overriding Style Settings

        • Automatically Applying a Style with TargetType

        • Subclassing Existing Styles

        • The Role of Unnamed Styles

        • Defining Styles with Triggers

        • Defining Styles with Multiple Triggers

        • Animated Styles

        • Assigning Styles Programmatically

      • Generating Styles with Expression Blend

        • Working with Default Visual Styles

      • Summary

    • WPF Control Templates and UserControls

      • Understanding the Role of Dependency Properties

        • Examining an Existing Dependency Property

        • Important Notes Regarding CLR Property Wrappers

      • Building a Custom Dependency Property

        • Adding a Data Validation Routine

        • Responding to the Property Change

      • Understanding Routed Events

        • The Role of Routed Bubbling Events

        • Continuing or Halting Bubbling

        • The Role of Routed Tunneling Events

      • Logical Trees, Visual Trees and Default Templates

        • Programmatically Inspecting a Logical Tree

        • Programmatically Inspecting a Visual Tree

        • Programmatically Inspecting a Control’s Default Template

      • Building a Custom Control Template with Visual Studio 2010

        • Templates as Resources

        • Incorporating Visual Cues using Triggers

        • The Role of {TemplateBinding} Markup Extension

        • The Role of ContentPresenter

        • Incorporating Templates into Styles

      • Building Custom UserControls with Blend

        • Creating a UserControl Library Project

        • Renaming the Initial UserControl

        • Designing the SpinControl

        • Adding the Initial C# Code

        • Defining an Animation using Blend

        • Programmatically Starting our Storyboard

      • Creating the Jackpot Deluxe WPF Application

        • Extracting a UserControl from a Drawing Geometry

        • The Role of .NET 4.0 Visual States

        • Defining Visual States for the StarButton Control

        • Defining State Transition Timings

        • Viewing the Generated XAML

        • Changing Visual States in Code using the VisualStateManager Class

        • Finalizing the Jackpot Deluxe Application

      • Summary

  • Part 7: Building Web Applications with ASP.NET

    • Building ASP.NET Web Pages

      • The Role of HTTP

        • The HTTP Request/Response Cycle

        • HTTP Is a Stateless Protocol

      • Understanding Web Applications and Web Servers

        • The Role of IIS Virtual Directories

        • The ASP.NET Development Web Server

      • The Role of HTML

        • HTML Document Structure

        • The Role of an HTML Form

        • The Visual Studio 2010 HTML Designer Tools

        • Building an HTML Form

      • The Role of Client-Side Scripting

        • A Client-Side Scripting Example

      • Posting Back to the Web Server

        • Postbacks under ASP.NET

      • The Feature Set of the ASP.NET API

        • Major Features of ASP.NET 1.0-1.1

        • Major Features of ASP.NET 2.0

        • Major Features of ASP.NET 3.5 (and .NET 3.5 SP1)

        • Major Features of ASP.NET 4.0

      • Building a Single File ASP.NET Web Page

        • Referencing AutoLotDAL.dll

        • Designing the UI

        • Adding the Data Access Logic

        • The Role of ASP.NET Directives

        • Analyzing the “Script” Block

        • Analyzing the ASP.NET Control Declarations

        • Compilation Cycle for Single-File Pages

      • Building an ASP.NET Web Page using Code Files

        • Referencing the AutoLotDAL.dll Assembly

        • Updating the Code File

        • Compilation Cycle for Multifile Pages

        • Debugging and Tracing ASP.NET Pages

      • ASP.NET Web Sites and ASP.NET Web Applications

      • The ASP.NET Web Site Directory Structure

        • Referencing Assemblies

        • The Role of the App_Code Folder

      • The Inheritance Chain of the Page Type

      • Interacting with the Incoming HTTP Request

        • Obtaining Brower Statistics

        • Access to Incoming Form Data

        • The IsPostBack Property

      • Interacting with the Outgoing HTTP Response

        • Emitting HTML Content

        • Redirecting Users

      • The Life Cycle of an ASP.NET Web Page

        • The Role of the AutoEventWireup Attribute

        • The Error Event

      • The Role of the Web.config File

        • The ASP.NET Website Administration Utility

      • Summary

    • ASP.NET Web Controls, Master Pages and Themes

      • Understanding the Nature of Web Controls

        • Understanding Server-Side Event Handling

        • The AutoPostBack Property

      • The Control and WebControl Base Classes

        • Enumerating Contained Controls

        • Dynamically Adding and Removing Controls

        • Interacting with Dynamically Created Controls

        • Functionality of the WebControl Base Class

      • Major Categories of ASP.NET Web Controls

        • A Brief Word Regarding System.Web.UI.HtmlControls

        • Web Control Documentation

      • Building the ASP.NET Cars Web Site

        • Working with ASP.NET Master Pages

        • Working with the TreeView Control Site Navigation Logic

        • Establishing Bread Crumbs with the SiteMapPath Type

        • Working with the AdRotator

        • Defining the Default Content Page

        • Designing the Inventory Content Page

        • Enabling Sorting and Paging

        • Enabling In-Place Editing

        • Designing the Build-a-Car Content Page

      • The Role of the Validation Controls

        • The RequiredFieldValidator

        • The RegularExpressionValidator

        • The RangeValidator

        • The CompareValidator

        • Creating Validation Summaries

        • Defining Validation Groups

      • Working with Themes

        • Understanding *.skin Files

        • Applying Sitewide Themes

        • Applying Themes at the Page Level

        • The SkinID Property

        • Assigning Themes Programmatically

      • Summary

    • ASP.NET State Management Techniques

      • The Issue of State

      • ASP.NET State Management Techniques

      • Understanding the Role of ASP.NET View State

        • Demonstrating View State

        • Adding Custom View State Data

      • The Role of the Global.asax File

        • The Global Last-Chance Exception Event Handler

        • The HttpApplication Base Class

      • Understanding the Application/Session Distinction

        • Maintaining Application-Level State Data

        • Modifying Application Data

        • Handling Web Application Shutdown

      • Working with the Application Cache

        • Fun with Data Caching

        • Modifying the *.aspx File

      • Maintaining Session Data

        • Additional Members of HttpSessionState

      • Understanding Cookies

        • Creating Cookies

        • Reading Incoming Cookie Data

      • The Role of the <sessionState> Element

        • Storing Session Data in the ASP.NET Session State Server

        • Storing Session Data in a Dedicated Database

      • Understanding the ASP.NET Profile API

        • The ASPNETDB.mdf Database

        • Defining a User Profile Within Web.config

        • Accessing Profile Data Programmatically

        • Grouping Profile Data and Persisting Custom Objects

      • Summary

  • Programming with Windows Forms

    • The Windows Forms Namespaces

    • Building a Simple Windows Forms Application

      • Populating the Controls Collection

      • The Role of System.EventArgs and System.EventHandler

    • The Visual Studio Windows Forms Project Template

      • The Visual Designer Surface

      • Dissecting the Initial Form

      • Dissecting the Program Class

      • Visually Building a Menu System

    • The Anatomy of a Form

      • The Functionality of the Control Class

      • The Functionality of the Form Class

      • The Life Cycle of a Form Type

    • Responding to Mouse and Keyboard Activity

      • Determining Which Mouse Button Was Clicked

      • Determining Which Key Was Pressed

    • Designing Dialog Boxes

      • The DialogResult Property

      • Configuring the Tab Order

      • The Tab Order Wizard

      • Setting the Form’s Default Input Button

      • Displaying Dialog Boxes

      • Understanding Form Inheritance

    • Rendering Graphical Data Using GDI+

      • The System.Drawing Namespace

      • The Role of the Graphics Type

      • Obtaining a Graphics Object with the Paint Event

      • Invalidating the Form’s Client Area

    • Building a Complete Windows Forms Application

      • Building the Main Menu System

      • Defining the ShapeData Type

      • Defining the ShapePickerDialog Type

      • Adding Infrastructure to the MainWindow Type

      • Implementing the Tools Menu Functionality

      • Capturing and Rendering the Graphical Output

      • Implementing the Serialization Logic

    • Summary

  • Platform-Independent .NET Development with Mono

    • The Platform-Independent Nature of .NET

      • The Role of the CLI

      • The Mainstream CLI Distributions

      • The Scope of Mono

    • Obtaining and Installing Mono

      • Examining Mono’s Directory Structure

    • The Mono Development Languages

      • Working with the C# Compiler

      • Building Mono Applications using MonoDevelop

    • Microsoft-Compatible Mono Development Tools

      • Mono-Specific Development Tools

      • Using monop

    • Building .NET Applications with Mono

      • Building a Mono Code Library

      • Assigning CoreLibDumper.dll a Strong Name

      • Viewing the Updated Manifest with monodis

      • Installing Assemblies into the Mono GAC

      • Building a Console Application in Mono

      • Loading Your Client Application in the Mono Runtime

      • Building a Windows Forms Client Program

      • Executing Your Windows Forms Application Under Linux

    • Who is Using Mono?

    • Suggestions for Further Study

    • Summary

  • Index

    • ¦SPECIAL CHARACTERS

    • AND NUMERICS

    • ¦A

    • ¦B

    • ¦C

    • ¦D

    • ¦E

    • ¦F

    • ¦G

    • ¦H

    • ¦I

    • ¦K

    • J

    • ¦

    • ¦L

    • ¦M

    • ¦N

    • ¦O

    • ¦P

    • ¦Q

    • ¦R

    • ¦S

    • ¦T

    • ¦U

    • ¦V

    • ¦W

    • ¦X

    • ¦Y

    • Z

    • ¦

Tài liệu cùng người dùng

Tài liệu liên quan