INDEX

Symbols $ (regular expression escape sequence), 221 ^ (regular expression escape sequence), 221 \’, 35 // (single-line comments), 25, 53 \ “, 35 /// (XML documentation), 53 \\, 35 [ ] index operator, 152, 172 \0, 35 @ symbol \a, 35 identifi ers and, 59 \b, 35 string literals and, 37, 220 \f, 35 verbatim strings and, 219 \n, 35 \r, 35 \t, 35 A \v, 35 { }. See curly braces abstract (modifi er), 100 ==. See comparison operators abstract classes, 93 ; See semicolons abstract functions, 93 ‘. See single quotation mark AccelerationRatio, 1022 “. See double quotation marks AcceptAllChanges(), 873 & AcceptChanges(), 837, 838 address operator, 152, 319 AcceptSocket(), 672, 679 bitwise AND, 152, 157, 172, 319, 336 access control entries (ACE), 559, 805 * access control lists. See ACLs escape sequence (regular expression), 221 access modifi ers, for properties, 73 indirection operator, 152, 319 AccessDataSource, 1162 multiplication, 157, 167, 168, 319 accessing array elements, 130–131 + Account class, 124, 125 addition operator, 151, 164, 165 Account property (ServiceProcessInstaller class), 681 escape sequence (regular expression), 221 Accumulate(), 125, 126, 965, 966 string concatenation operator, 151 AccumulateSimple(), 124, 125 ( ) (cast operator), 152, 172 ACE (access control entries), 559, 805 . (regular expression escape sequence), 221 ACID (atomicity, consistency, isolation, durability), : : (namespace alias qualifi er), 47, 152 607, 635 /, % (division operator), 151,COPYRIGHTED 152, 153, 157 acknowledgment MATERIAL messages, 1361 | (bitwise OR), 152, 157, 172, 319, 336 acknowledgment queues, 1376–1377 /*.../* (multiline comments), 25, 53 ACLs (access control lists), 558–561, 568 ? adding/removing, from fi le, 805–806 escape sequence (regular expression), 221 COM interop and, 802 operator, 123 discretionary, 559 ?: (conditional (ternary) operator), 152, 154, 157, programming, 568 223, 224 reading ?? (null coalescing operator), 123, 152, 156–157 from directory, 803–804 -› (pointer member access operator), 323–324 from fi le, 802–803 # (preprocessor directives), 55–58, 387 system, 559

1417

bbindex.inddindex.indd 14171417 11/28/10/28/10 11:27:44:27:44 PMPM action links – AdventureWorks database

action links, 1267–1268 connection strings and, 821–822 Action‹T›, 190, 759 data binding and, 1169–1180 Domain Services Integration, data reader and, 832–834 1360, 1361 database connections, 820–821, 822–824 Active Directory domains, 1361, 1364 database development active phase (transactions), 606 key generation with SQL Server, 857–858 Active Server Pages (ASP) technology, 1149 naming conventions, 859–860 Active Template . See ATL tiered development, 856–857 ActiveX controls database-specifi c classes, 819 server-side controls v., 18 disconnected record set, 817, 818, 819 Windows Controls v., 19 namespaces, 818 ActiveX Data Objects. See ADO object model, 817, 835–844 activities (Workfl ow 4), 1309, 1311–1322. See also overview, 817–820 workfl ows; specifi c activities shared classes, 818–819 class hierarchy, 1311 stored procedures custom, 1316–1322 calling, 829–832 custom composite, 1319–1322 naming conventions, 859–860 designers for, 1317–1319 transactions, 824–825 Retry, 1319, 1320, 1321, 1322 System.Transactions v., 609–610 workfl ows as, 1311 transaction scope, 824–825 Activity Designer Library, 381, 1317 XML and, 844, 927–934 Activity Library, 381 converting ADO.NET data to XML, 927–932 activity validation, 1317 converting XML to ADO.NET data, 932–934 Activity‹TResult›, 1311 XML schemas and, 844–850 ActivityWithResult, 1311, 1312 ADO.NET Entity Data Model. See EDM Add(), 51, 54, 108, 109, 226, 229, 236, 246, 252, 255, ADO.NET Entity Data Model Designer, 864 263, 264, 265 ADO.NET , 294, 861–884 Add New Project dialog box, 385 ambient transactions and, 635 Add Service Reference (Visual Studio), 1304, 1305 classes, 818 AddDocument(), 114, 238, 244 entity classes, 868–871 AddDocumentToPriorityNode(), 244 Entity Client, 866–867 AddHandler(), 738 Entity SQL, 862, 867–868 $addHandler(), 1234 LINQ to Entities and, 883–884 adding pointers, 322 LINQ to SQL and, 293 add-ins, 747. See also MEF; parts mapping, 862–866 MAF and, 747–748 object contexts, 871–873 as parts, 749 object queries, 876–879 addition operator (+), 151, 164, 165 overview of, 861–862 AddLast(), 110, 112, 113, 242, 244, 265 relationships, 873–876 AddMessageFilter, 1119 updates and, 879–884 AddObject(), 873, 881, 900 WCF Data Services with, 885–886, 894–895 AddRange(), 229, 230 ADOXML.cs (code snippet), 927, 928, 929, 931, 932 AddRef(), 696, 705, 709, 713 AdRotator, 1161 AddRemoveProgramsIcon, 414 ADSI COM, 695 address operator (&), 152, 319 Advanced Encryption Standard (AES), 554, 557 AddStudent(), 608, 612, 613, 618 AdvCalculator, 752 AddToAmount(), 86, 87 AdvCalculator/Calculator.cs, 753 AddWithValue(), 826, 830 AdventureWorks database, 955, 965, 967, 970 administration queues, 1363 SqlSamplesUsingAdventureWorks/CalcHash.cs, 969 administration tool (for Windows Services), 668 SqlSamplesUsingAdventureWorks/ administrative privileges, UAC and, 1404–1405 GetCustomerOrdersCLR.cs, 968 ADO (ActiveX Data Objects), 817–818 SqlSamplesUsingAdventureWorks/InsertContact.cs, ADO.NET, 817–860 971 ADO v., 817–818 SqlSamplesUsingAdventureWorks/SampleSum.cs, commands and, 825–829 966

1418

bbindex.inddindex.indd 14181418 11/28/10/28/10 1:27:441:27:44 PMPM AdventureWorksLT sample application – arrays

AdventureWorksLT sample application, 927 Sandbox API, 562, 565–566 AES (Advanced Encryption Standard), 554, 557 Windows API Code Pack, 1397–1398, 1402, 1407, AesCryptoServiceProvider, 554, 557, 558 1408, 1410, 1415 Aggregate(), 276, 286 AppDomain class, 441, 442, 444 aggregate operators (query operator category), 276, AppDomainHost/Program.cs, 566 286–287 AppearanceEditorPart, 1211 Aggregate template, 966 AppendFormat(), 211, 212, 214, 215 AggregateCatalog, 768 AppendOnly, 876 aggregates, 964–965 application (ASP.NET), 1181. See also web applications built-in, 964–965 application cache (ClickOnce fi les), 421 user-defi ned, 964–967, 980 Application class , 1218–1221. See also ASP.NET AJAX ASP.NET AJAX Library, 1237 alert (escape sequence), 35 System.Windows.Forms, 1118–1119 Alice/Bob/Eve (encryption example), 553 WPF, 986 All (quantifi er operator), 276 application confi guration (ASP.NET), 1181–1182 ‘all or nothing’ characteristic, of transactions, 605 application deployment. See deployment AllowDirectoryBrowsing, 418 application domains, 11–13 AllowPartiallyTrustedCallers, 565 assemblies and, 441–444 AllowReadAccess, 418 CLR and, 956 AllowRecomposition, 763, 767 virtual memory and, 12–13 AllowScriptSourceAccess, 418 application , 419, 420–421 AllowWriteAccess, 418 Application object, 1181 AltDirectorySeparatorChar, 775 application recovery (Restart Manager), 1398–1403 ‹AlternatingItemTemplate›, 1177 Application Recovery and Restart (ARR), 1398 ambient transactions, 618–624, 635 Application.init, 1237 multithreading with, 621–624 Application.load, 1237 nested scopes with, 620–621 ApplicationProtection, 418 AnalyzeType(), 343, 344 ApplicationRestartRecoveryManager, 1402, 1403 Ancestors(), 293 application-to-application e-mail communication, anchor to blocks, 1083–1084 1358. See also Message Queuing AnchoredBlock, 1083 Application.unload, 1238 And(), 258, 259 ApplyPropertyChanges(), 873 AnimationDemo/ButtonAnimationWindow.xaml, 1022 AppMappings, 418 AnimationDemo/EllipseWindow.xaml, 1021, 1023 AppServices/SampleRoleProvider.cs, 550 AnimationDemo/EventTriggerWindow.xaml, 1025 AppServices/web.confi g, 551 AnimationDemo/KeyFrameWindow.xaml, 1026 AppSupport, 409–410 animations (WPF), 1020–1029 App.xaml, 595, 1005, 1013, 1098 elements of, 1020 ArcSegment, 989 event triggers, 1020, 1023–1025 ArgsExample.cs, 49 keyframe, 1025–1026 ArgumentException, 244, 246, 352, 353, 362 non-linear, 1023 ArgumentNullException, 353 Timeline, 1020–1023 arguments, workfl ows and, 1322–1323 Visual State Manager and, 1026–1029 arithmetic, on pointers, 322–323 anonymous functions. See anonymous methods; arithmetic operators, 151 Lambda expressions ARR (Application Recovery and Restart), 1398 anonymous methods, 196 Array class, 129, 134–139, 149 delegates with, 196–197 array covariance, 139 dynamic programming (C#) and, 295 array initializers, 130, 132, 133, 228 anonymous types, 79 Array.Copy(), 136, 228 AnonymousMethods/Program.cs, 196–197 ArrayList, 108, 225, 228, 230, 264, 265, 288 AnotherButtonStyle, 1004 arrays, 129–140 Any (quantifi er operator), 276 bit, 258–260 apartment models. See MTAs; STAs copying, 135–136 creating, 134–135 reading/writing XAML and, 744 DataGridView control and, 1130–1131

1419

bbindex.inddindex.indd 14191419 11/28/10/28/10 1:27:451:27:45 PMPM arrays – assemblies

arrays (continued) Web Parts, 1210–1218 declaring, 129 web sites, 1150–1151 elements ASP.NET AJAX, 1218–1241, 1242 accessing, 130–131 Ajax and, 1218–1221 sorting, 136–139 AJAX Extensions, 1222–1223 on heap, 329 AJAX Library, 1223–1224 indexers and, 130–131 ASP.NET application services and, 1241 initializing, 130, 132, 133, 228 asynchronous web method calls and, 1240–1241 jagged, 133–134 confi guration, 1227 multidimensional, 132–133 defi ned, 1221 as parameters, 139–140 downloads for, 1221 reference types and, 131–132 functionality, 1221–1224 simple, 129–132 adding to web site, 1227–1233 on stack, 329–330 JavaScript debugging and, 1239–1240 stack-based, 329–331 JSON and, 1221, 1222 syntax, pointers and, 331 web site example, 1224–1226 tuples v., 147–149 ASP.NET AJAX Control Toolkit, 1224, 1227 ArraySegmentSample/Program.cs, 140 ASP.NET AJAX Extensions, 1222–1223 ArraySegment‹T›, 140 ASP.NET AJAX Library, 1223–1224 as operator, 152, 155 adding JavaScript to web page, 1234 ASCII format, 785, 791, 794, 795, 796 global utility functions, 1234 AsEnumerable, 276 JavaScript OOP extensions, 1235–1236 ASP (Active Server Pages) technology, 1149 layers of, 1223 AsParallel(), 289, 290 PCSLibraryDemo project, 1234–1241 ASP.NET ASP.NET AJAX Server Control, 380 application confi guration, 1181–1182 ASP.NET AJAX Server Control Extender, 380, 1232 application services, AJAX and, 1241 ASP.NET AJAX-enabled web site confi guration, 1227 architecture, 1150 ASP.NET MVC, 1243, 1259–1274. See also dynamic code model, 1154–1155 data; routing code-behind feature, 18 dynamic data and, 1243 controls. See ASP.NET server controls MVC v., 1260 core, 1149–1183 Web.confi g, 1261 CSS and, 1149 ASP.NET MVC 2 Web Application, 380, 1261 dynamic data. See dynamic data ASP.NET MVC applications features, 17–18, 1185–1242 customizing, 1266–1274 fi les MagicShop.mdf database, 1261–1274 components, 1150 action links, 1267–1268 processing, 1150 controller added to, 1262–1263 IIS and, 409, 1150 creating, 1261 introduction, 1150–1151 customizing, 1266–1274 localization with, 591–593 index operation added to, 1263 master pages, 1195–1198 inspecting, 1261–1262 MVC, 1243, 1259–1274 model added to, 1262 PCSDemoSite. See PCSDemoSite products view added to, 1263–1266 Professional ASP.NET4: in C# and VB, 247, 1156, URL operation routing, 1266–1267 1181 viewing items with details, 1268–1269 role-based security and, 547 ASP.NET server controls, 1155–1169. See also custom routing, 1244–1251 controls; user controls; Web Parts; web server sandboxing and, 561 controls security and, 1201–1206 event-booking example, 1164–1175 server controls. See ASP.NET server controls HTML, 1155 site navigation, 1198–1201 project type, 380 state management in, 1151 ASP.NET Web Application (project type), 380 themes, 1206–1210 ASP.NET Web Site template, 1153, 1224 web applications, 1150–1151 assemblies, 431–459. See also shared assemblies Web Forms. See Web Forms application domains and, 441–444

1420

bbindex.inddindex.indd 14201420 11/28/10/28/10 1:27:461:27:46 PMPM – authorization

attributes, 436–438 asynchronous page requests (WebRequest class), binding to, 453–454 642–643 creating, 435–441 asynchronous programming. See also WebRequest/ defi ned, 431–432 WebResponse classes delayed signing of, 449–450 Message Queuing v., 1357–1358 demanding permissions programmatically, WebRequest and, 535 564–565 WebResponse and, 535 dynamic, creating/loading, 438–441 asynchronous web method calls, 1240–1241 features of, 432, 458–459 AsyncPattern (OperationContract property), 1293 ildasm tool and, 14, 297, 434, 435, 448, 449 AsyncPostBackTrigger, 1223 manifests, 14, 433 @ symbol and, 14, 15 identifi ers and, 59 modules v., 435–436 string literals and, 37, 220 namespaces v., 46, 434 verbatim strings and, 219 overview, 14–15 ATL (), 90, 379, 418, 702, 721 private, 14–15, 434, 447, 448, 452, 453, 454, 459 ATL library, 90 references to, 450–451 ATL Project Wizard, 702, 718 satellite, 434, 579, 581, 588, 590, 594, 597, 598, 603 Atom format, 886, 1387, 1388, 1390, 1394 shared. See shared assemblies Atom10FeedFormatter, 1388 structure of, 432–433 Atom10ItemFormatter, 1388 versions atomicity, 607 binding to, 456–457 atomicity, consistency, isolation, durability. See ACID programmatically getting, 455–456 AtomPub, 885, 886, 889, 891, 892, 893, 894, 895, 901, version numbers, 455 902, 1282 viewing, 434–435 Attach(), 873 assembly: prefi x, 437 attached properties, 739–741 Assembly class, 344–345 AttachedPropertyDemo/MainWindow.xaml, 740, 741 AssemblyA/Program.cs, 442 AttachedPropertyDemo/MyAttachedProperty AssemblyCompany, 437 Provider.cs, 740 AssemblyCopyright, 437 attaching/detaching entities, 882 AssemblyCulture, 437 AttachTo(), 873 AssemblyDefaultAlias, 437 attribute parameters, 336–337 AssemblyDescription, 437 AttributedModelServices, 751, 767 AssemblyFileVersion, 437 attributes. See also custom attributes; specifi c attributes Assembly.GetTypes(), 344 assembly, 436–438 AssemblyInfo.cs, 384, 436, 455, 581 COP interop, 716–717 AssemblyInformationalVersion, 437 IDL and, 13 AssemblyProduct, 437 .NET Framework and, 13 AssemblyTitle, 437 properties as (XAML), 730–731 AssemblyTrademark, 437 AttributeTargets enumeration, 335 AssemblyVersion, 437 AttributeUsage attribute, 335–336 assignment operators, 152, 157 authentication/authorization, 545–552 asymmetric key algorithms, 554 client application services and, 548–552 asymmetric keys, 552–554 Forms Authentication, 548, 551, 1201, 1202 async pattern. See asynchronous component pattern; identity/principal and, 545–547 asynchronous event pattern Live ID Authentication, 1201 AsyncCodeActivity, 1311, 1312, 1314 role-based security, 547–548, 568 AsyncCodeActivity‹TResult›, 1311, 1312 v., 11 AsyncComponent/AsyncComponent.cs, 540 declarative, 547–548 AsyncComponent/Program.cs, 543 WebRequest class and, 642 AsyncDelegate/Program.cs, 492, 493, 494, 522 Windows Authentication, 820, 1201 asynchronous callbacks, 494–495, 534 AuthenticationServices/app.confi g, 552 asynchronous component pattern, 539–543, 1106 authenticode signature, 416, 445 asynchronous delegates, 492–495, 496, 522 Author (project property), 414 asynchronous event pattern, 534–543, 1106, authorization, 545. See also authentication/ 1109, 1293 authorization

1421

bbindex.inddindex.indd 14211421 11/28/10/28/10 1:27:471:27:47 PMPM Authors table – BooksDemo application (WPF)

Authors table, 863 BezierSegment, 989 AutoComplete attribute, 610, 1294 BigClassPart1.cs, 81, 82 AutoDisposeParameters, 1298 BigClassPart2.cs, 81, 82 auto-implemented properties, 74 BigEndianUnicode, 795 AutoLog, 675 Binary Application Markup Language. See BAML automatic fallback, for resources, 590 binary code reuse, generics and, 109 automatic transactions, 610, 611, 636, 1279 binary operators, 156, 167, 172, 319 AutomaticSessionShutdown, 1294 BinaryFileReader (sample application), 791–793 AutoReverse, 1022 BinaryFileReader.sln, 792, 793 Autos window, 399 BinaryReader, 788, 794 AVERAGE, 964, 965 BinaryWriter, 788 Average(), 276, 286 binding. See also data binding to assemblies, 453–454 B to assembly versions, 456 early, 21, 698 Background property, 1003 late, 433, 698, 715 background threads, 497–498 method binding, 698 BackgroundWorker, 535–539 WCF and, 1300–1302 BackgroundWorkersSample/Window1.xaml.cs, 536, Binding elements, 994, 1044, 1048, 1050, 1300 537, 538 binding validation (WPF), 1057–1061 backslash, escape sequences and, 35, 221 bit arrays, 258–260 backspace (escape sequence), 35 bit vectors, 260–262 backward compatibility, pointers and, 317 BitArraySample/Program.cs, 258, 260 BAML (Binary Application Markup Language), 595, BitVector32, 260–262 597, 728, 744, 1096 bitwise AND (&), 152, 157, 172, 319, 336 LocBaml tool, 597–598 bitwise binary, 172 Viewer, 1321 bitwise OR (|), 152, 157, 172, 319, 336 Baml2006Reader, 744, 984 bitwise unary, 172 bank account example, 101–104 bitwise XOR, 157 BankAccounts.cs, 102 blittable data types, 701 Bar(), 127, 128 Block (base class), 1080 Barrier class, 529–530 Block elements, 1080–1081 BarrierSample/Program.cs, 529 block scope, 308 base class library (ASP.NET AJAX Library layer), 1223 BlockingCollection‹T›, 263 base classes (.NET base classes). See also specifi c base blocks, curly braces and, 25, 38 classes Bob/Alice/Eve (encryption example), 553 casting base classes to derived classes, 177–178 Book class, 868, 1010, 1040, 1042, 1043, 1054 comprehensiveness of, 16 book model (3-D with WPF), 1030–1033 base keyword, 96 bookmarks, workfl ows and, 1324–1325 base.‹MethodName›() syntax, 93 BookOfTheDay ( localization), BaseType (System.Type), 341 584–590 BaseValidator, 1163 BookOfTheDay/BookOfTheDayForm.cs, 589, 590 BasicHttpBinding, 1300 BookOfTheDay/BookOfTheDayForm.resx, 587 BasicWebClient.sln, 638 BookOfTheDay/Demo.BookOfTheDayForm. batching (data service context), 901–902 Designer.cs, 586 beatlesClone, 136 BookOfTheDay/Program.cs, 589 BeginEdit(), 837, 838, 839 Books table, 861, 863, 866, 867 BeginExecute(), 1109 BooksAuthors table, 863 BeginGetResponse(), 642, 643 BooksDemo application (WPF), 1036–1037 BeginInvoke(), 493 adding list items dynamically, 1053 Beginning Regular Expressions (Wiley), 218 binding to XML, 1055–1057 BeginTime, 1022 command bindings, 1063 BehaviorEditorPart, 1212 commanding, 1061–1063 Berkeley sockets interface, 637 defi ning command sources, 1062 Bézier curves, 989 defi ning commands, 1062

1422

bbindex.inddindex.indd 14221422 11/28/10/28/10 1:27:481:27:48 PMPM BooksDemo/BooksModel.Designer.cs – C++ (programming language)

data template selector, 1053–1055 commanding, 1061–1063 value conversion, 1051–1052 data binding, 1035–1051 BooksDemo/BooksModel.Designer.cs, 870, 872 DataGrid control, 1067–1073 BooksDemo/BooksModel.edmx, 864, 865, 866 TreeView control, 1063–1067 BooksDemo/Program.cs, 867, 868, 871 validation, 1057–1061 BooksModel.edmx, 864, 865, 866, 867 value conversion, 1051–1057 books., 905–906 Button class booksxpath.xml and, 919 Windows Forms, 984 code for reading in, 906–907 WPF, 984, 995 iterating through attributes of, 909–910 Button control, 1160 XSD schema and, 910–911 Button element, 728, 729, 730, 731 XslSample01.sln and, 922, 923 styles and, 1003–1004 booksxpath.xml, 919 ButtonBase, 995 books.xsd, 910, 911 ButtonChrome, 998 BookUtils, 923, 924 buttons, 1125–1126. See also command link controls bool (value type), 35 byte, 33 Boolean AND, 157 byte code Boolean OR, 157 Java, 4 Border class, 998 markers, 794 boxing, 108, 111, 161, 178–179 break statements, 39, 43–44 C breakpoints, 398–399 browser compatibility (ASP.NET AJAX Library layer), ‹c›, 53 1223 C#, , C++/CLI, and F# (online Chapter 53), browser integration (Silverlight), 1110–1113 7, 726 calling out to JavaScript, 1111 C (currency format), 52, 213 JavaScript calling Silverlight, 1112–1113 C# (programming language) Browser.sln, 644, 647–649 ASP.NET applications with, 17–19 brushes (WPF), 991–994 case sensitivity, 61, 73 BrushesDemo/MainWindow.xaml, 991 compilation process in, 4 BSTR, 698, 701, 706 core/fundamentals, 23–64 BubbleDemo/MainWindow.xaml, 736, 737 dynamic capabilities of, 295 BubbleSorter, 190–193 fl ow control, 37–44 BubbleSorter/BubbleSorter.cs, 192 guidelines, 58–64 BubbleSorter/Employee.cs, 192 .NET base classes and, 16 BubbleSorter/Program.cs, 193 .NET enterprise architecture and, 20–21 bubble-sorting algorithm, 191 .NET Framework v., 3–4 bubbling events, 201, 736–739 object-oriented programming and, 3 buffer, 789 signifi cance of, 3 buffered streams, 788–789 strong data typing and, 157 BufferedStream, 788, 789 syntax, 25–26 Build - Publish menu, 411 C++ (programming language). See also Visual C++ 2010 Build Deploy Project menu, 963 ATL library, 90 building. See also compilation Chapter 53 (C#, Visual Basic, C++/CLI, and F#) and, compiling v., 394–395 7, 726 making v., 394 exception handling, 13 strings, 207, 209–212 exceptions and, 351 WF applications (in Visual Studio 2010), 405–406 header fi les, 47 Building table, 841 interoperability and, 7 built-in aggregates, 964–965 managed, 6, 8 built-in controls (Windows Forms), 1125–1140 memory leaks, 10 BulletDecorator, 998, 999 multiple inheritance, 90 BulletedList, 1161 preprocessor directives and, 55 business applications (WPF), 1035–1073. See also pure virtual function, 93 BooksDemo application; Formula-1 sample database templates, 107

1423

bbindex.inddindex.indd 14231423 11/28/10/28/10 1:27:491:27:49 PMPM C++ (programming language) – class members

C++ (programming language) (continued) fl oat to Currency, 175–176 unmanaged, 6, 11 fl oat to long, 179 using namespace statement, 25 fl oat to uint, 175 Cab Projects, 412 generics and, 113 CAB size (project property), 416 implicit, 158–159 CalcHash(), 969, 970 multiple, 179–182 CalcTax(), 302 nullable types, 159, 160–161 Calculator property, 751, 764 pointers to integer types, 320–321 CalculatorContract, 754 pointers to other pointers, 321 CalculatorContract/ICalculatorExtension.cs, 754 QueryInterface() and, 698 CalculatorExtension, 742 type safety and, 157 CalculatorUtils/ExportAttribute.cs, 762 types, 158–161 CalculatorUtils/ISpeedCapabilities.cs, 762 uint to fl oat, 174 Calendar control, 995, 1161, 1172–1174 unboxing and, 108, 111, 161, 178–179 callbacks, asynchronous, 494–495, 534 user-defi ned, 172–182 calling base versions of functions, 93 Cast‹TResult›, 276 calling constructors from other constructors, 77–78 catalogs (MEF), 748, 749, 767–769 CallingConvention, 724 CatalogZone, 1211 CallSite, 299, 300 catch blocks, 353–354, 355–359 CallSiteBinder, 299, 300 catching camel casing, 61 exceptions, 353–359 cameras (3-D with WPF), 1030, 1032 user-defi ned exceptions, 363–364 Cancel(), 290 Categories table, 843, 857, 858 CancelEdit(), 837, 839 Category class, 886, 887, 894 cancellation framework, 290–291, 507–510 CategoryCount, 479 CancellationSamples/Program.cs, 508, 510 CategoryResourceFile, 479 CancellationToken, 290, 291, 507, 508, 509 CCOMDemo, 705 CanGoBackChanged(), 650 CCW (COM callable wrapper), 713, 716, 718, 719, 726 CanGoForwardChanged(), 650 Certifi cate Manager, 568 CanHandlePowerEvent, 675 certifi cates, 567–568 CanHandleSessionChangeEvent, 675 Certifi cates MMC snap-in, 568 CanPauseAndContinue, 675, 685 change information, 881–882 CanShutdown, 685 ChangePassword, 1204 CanStop, 685 ChangeRejectedException, 751 Canvas panel, 1000–1001, 1005 ChannelFactory, 1297, 1304, 1305, 1307, 1383 captures (regular expressions), 223–224 Chaos (isolation level), 625 CarDealer, 200, 201, 202, 203, 204 char (data type), 35 CardSpace, Windows, 404 character escape sequences, 35, 221, 318 carriage return (escape sequence), 35 CharSet, 724 cascading style sheets. See CSS Chart control, 1163 case sensitivity check boxes (dialog box), 424 C#, 61, 73 CheckBox control, 1126, 1160 format strings and, 52 CheckBoxList, 1160 identifi ers and, 58 CheckBoxRadioButton, 995 IL, 9 CheckedListBox, 1127–1128 Visual Basic.NET and, 61, 62 checked/unchecked operators, 152, 154–155 casing schemes, 60–61 Circle(), 145 cast operator [( )], 152, 172 clashes, variable scope, 29–31 casting, 172 class hierarchy base classes to derived classes, 177–178 exceptions, 352, 353 boxing and, 108, 111, 161, 178–179 Windows Forms, 1122 classes to other classes, 176–178 WPF, 985–986 Currency to fl oat, 173–174 class ID. See CLSID Currency to ulong, 180 Class Library (project type), 379, 380, 387 danger of, 159 class members, 66 explicit, 159–161, 172–173

1424

bbindex.inddindex.indd 14241424 11/28/10/28/10 1:27:491:27:49 PMPM Class View window – code snippets

data members, 66–67. See also constants; ClientWPF, 409 events; fi elds Clone(), 135, 136 function members, 67. See also constructors; fi nalizers; Close(), 82, 315, 810, 823. See also Dispose() indexers; methods; operators; properties closing database connections, 822–824, 860 pointers to, 324–325 Cloud property, static members of, 1347–1348 Class View window, 392–393 Cloud Services, 381 classes. See also base classes; class hierarchy; derived clouds classes; Object class; structs defi ned, 1342 abstract, 93 link local, 1344 casting classes to classes, 176–178 PNRP, 1344–1345 event logging, 477–478 site local, 1345 exception, 352–353 states, 1345 user-defi ned, 362–369 WCF endpoints and, 1348, 1349, 1352 generic, 110–118 well-connected, 1342 hierarchies and, 113 CLR (, .NET runtime) instances, objects and, 185 application domains and, 956 language interoperability and, 7 classes, encryption and, 969, 980 members. See class members code access permissions and, 562–563 naming conventions, 60–63 deploying, 409 new keyword and, 66 DLR and, 295 operator overloading and, 166 garbage collection and, 312 partial, 82–83 inlining and, 74 performance monitoring, 483 managed code and, 4, 6, 8, 10, 15, 16 pointers to, 324 .NET Framework and, 4 sealed, 94 objects, binding to, 1040–1041 static, 84 orphaned objects and, 32 structs v., 65–66, 81–82, 90 SQL Server and, 955–980 for Windows Services, 670 as CLR host, 956–957 in WPF, 983, 984, 985–986 stored procedures, 967–969 ClassInterface attribute, 717 triggers and, 970–972 Clear(), 478 user-defi ned functions, 969–970 Click event, 200, 206, 736, 737 versions ClickOnce technology, 408, 419–422 fi lenames and, 409 application cache, 421 installing/using multiple versions, 458 application security, 421–422 CLR objects, hosting with, 886–890 certifi cates and, 567 CLS (Common Language Specifi cation), 9–10 limitations, 420 CLSID (class ID), 699, 715, 716, 718 manifest fi les, 419, 420 cng (Cryptography Next Generation), 553 properties/settings, 420–421 coalescing operator. See null coalescing operator publishing applications, 420 ‹code›, 53 v., 420 code access permissions, CLR and, 562–563 client applications, WCF and, 1304–1305 code access security, 11, 561–567 client console application (Socket class), 663–664 custom attributes and, 334 Client Software Logo document (), 1398 permissions and, 562–567 ClientApp/app.confi g, 897 pointers and, 318 Client/App.confi g, 457, 458 role-based security v., 11 ClientApp/MainWindow.xaml.cs, 896, 897, 899, 900, security transparency level 2, 561, 562 901 in System.Net.PeertoPeer, 1349 ClientAuthenticationMembershipProvider, 551, 552 code bloat, generics and, 109–110 Client/Program.cs, 449, 455 code contracts, 461–466 ClientRoleProvider, 551 for interfaces, 465–466 client-server architecture, 1340 invariants, 465 ClientWinForms, 409 postconditions, 464 installers for, 413–417 preconditions, 463–464 xcopy deployment and, 410 code model, ASP.NET, 1154–1155 ClientWinFormsSetup, 413, 416 code snippets. See specifi c code snippets

1425

bbindex.inddindex.indd 14251425 11/28/10/28/10 1:27:501:27:50 PMPM CodeAccessPermission – compilation

CodeAccessPermission, 567, 1349 creating, 702–707 CodeAccessSecurityAttribute, 1349 RCW and, 707–709 CodeActivity, 1311, 1316 COM interop, 6, 16, 22, 695–726 CodeActivity‹TResult›, 1311, 1312 ACLs and, 802 ‹codeBase›, 453–454 attributes, 716–717 code-behind feature (ASP.NET), 18 COM objects, releasing, 708–709 CodeContractsSamples/IPerson.cs, 465 COM servers, 714 CodeContractsSamples/PersonContract.cs, 466 with dynamic language extensions, 709 CodeContractsSamples/Program.cs, 463, 464, 465 IDispatch interface and, 698, 709 CodeDriver, 438, 439, 443, 444 CombinedGeometry, 988 CodeDriverInAppDomain, 443, 444 ComboBox, 998, 1127–1128 CodeIntro/Program.cs, 729 COMClient/COMClient.cpp, 719, 721 CodePlex web site, 295 COMClient/stdafx.cpp, 721 coerce value callback, 734–735 COMClient/stdafx.h, 721 CoerceValue(), 734 COMDemo.cpp, 706, 712 cold calling, 362 command bindings, 1063, 1073 ColdCallFileFormatException, 363, 364, 365, 366, 368 command link controls, 1407–1408 ColdCallFileReader, 363, 364, 365, 366 command prompt (Visual Studio 2010), 24 collection initializers, 228–229 commanding (WPF), 1061–1063 collection interfaces/types, 225–226 defi ning command sources, 1062 CollectionChangedEventManager, 204 defi ning commands, 1062 collections, 225–266 commands (ADO.NET), 825–829. See also stored concurrent, 262–264 procedures foreach loop and, 43 executing, 826–829 generic collection classes. See generic collection classes stored procedures as, 825 observable, 256–258, 898–899 CommandType enumeration, 826 performance and, 264–266 comments, 53–55 read-only, 236 internal, 53 type conversions and, 235–236 multiline, 25, 53 XAML and, 731–732 single-line, 25, 53 Color.DateTime, 77 XML, 53–55 ColumnDefi nition, 1001 Commit(), 627, 679, 680 COM committable transactions, 612–614 apartment models. See MTAs; STAs CommittableTransaction, 611, 613, 617, 625 data types and, 698 committing phase (transactions), 606 errors and, 700 Common Language Runtime. See CLR event-handling architecture, 701 Common Language Specifi cation. See CLS exception handling, 13 . See CTS IDL, 13 CommonAppDataPath, 1118 interfaces and, 697–698. See also interfaces CommonObjectSecurity, 559 metadata and, 696 communication, P2P and, 1341, 1342 method binding and, 698 Compact Framework, 407, 408 .NET Framework v., 6, 695–701 Compare(), 137, 138, 208, 226 reference counts, 10, 696 CompareOrdinal(), 208 registration, 698–699, 718 CompareValidator, 1164 type library and, 696 comparing objects for equality. See also Equals() WebBrowser control and, 643 reference types, 162–163 COM+ value types, 163 hosting model, transactions (System. comparison operators, 151, 152, 163 EnterpriseServices) and, 611 overloading, 164, 170–171 .NET Framework and, 6 overriding, 163 COM callable wrapper (CCW), 713, 716, 718, 719, 726 compilation COM client application, 713, 718–719, 721 building v., 394–395 COM components conditional, 56–57, 396 connection points added to, 710–712 JIT, 4

1426

bbindex.inddindex.indd 14261426 11/28/10/28/10 1:27:511:27:51 PMPM CompileAndRun() – Control class

options (for C# fi les), 50–51 Console Application (project type), 379, 381, 397, 405, process, 4, 21–22 662, 1310 CompileAndRun(), 438, 440, 443 ConsoleApplication1.sln, 943, 944, 945, 946, 947, 949, Compile_Click(), 440, 444 950, 952, 953 Complete(), 616, 618, 619 Console.ReadLine(), 51 CompletionMethod, 539, 540, 541 Console.Write(), 51 ComplexObject, 870, 871 Console.WriteLine(), 51 Component Services MMC snap-in, 616 const keyword, 31, 66, 78 ComponentInstaller class, 680, 682 constants, 31, 66–67 ComposablePart, 748, 765, 767 advantages of, 31 composite activities, 1319–1322 readonly fi elds v., 78 CompositionContainer class, 751, 764, 765, 767, 768 Constraint class, 818 compound from clause, 278, 283 constraints compound from query, 288 data, 842–844 compression (project property), 416 delete, 843–844 ComputeHash(), 969 generic classes with, 114–116 Computer Management MMC snap-in, 1362 generic methods with, 125–126 COMServer/COMDemo.cpp, 707, 712 naming conventions, 859 COMServer/COMDemo.h, 706, 712 update, 843–844 COMServer/COMServer.idl, 703, 711 constructor initializer, 77–78 COMServer.idl, 696 constructors, 67, 74–78 ComVisible attribute, 716 calling constructors from other constructors, 77–78 Concat(), 208 of derived classes, 94–98 conceptual layer, 862, 864–865 fi nalizers v., 67 Conceptual Schema Defi nition Language. See CSDL in hierarchy, 96–97 ConcurrencyMode, 1295 with parameters, in hierarchy, 97–98 concurrent collections, 262–264 static, 75–77 cancellation framework and, 507 StreamReader and, 794–795 multiple threads and, 264 for structs, 82 ConcurrentBag‹T›, 263 XAML and, 732 ConcurrentDictionary‹TKey, TValue›, 263 zero-parameter, 76, 82 ConcurrentQueue‹T›, 262–263 Consumer class, 200, 202, 203, 205 ConcurrentSample/Program.cs, 263–264 contacts, peers and, 1353 ConcurrentStack‹T›, 263 containers (MEF), 748, 749, 765–767 ConcurrentXXX, 263 export providers and, 765–767 Condition (project property), 418 in MEF architecture, 748, 749 Conditional attribute, #if and, 57 Contains(), 240 conditional compilation, 56–57, 396 Contains (quantifi er operator), 276 conditional (ternary) operator (?:), 152, 154, 157, 223, content controls (WPF), 995–996 224 Content directory, 1261 conditional statements, 37–40. See also if statements; ContentControl class, 986, 995, 996 switch statements ContentPlaceHolder controls, 1196 confi g.MaxResultsPerCollection, 895 ContextMenu class, 998 confi rm installation (dialog box), 424 ContextMenuStrip control, 1141 connection, P2P and, 1341, 1342 continuation tasks, 502–503 connection point objects (CPOs), 701 Continue(), 690 connection points continue statement, 44 COM component and, 710–712 Contract class, 462 .NET component and, 720 contracts. See also specifi c contracts Connection String Example.txt, 821 MEF and, 749, 754–755 connection strings WCF and, 1291–1294 ADO.NET, 821–822 contra-variance, 118–123 EDM and, 867 Control class ConnectionsZone, 1212 FrameworkElement, 986 consistency (ACID), 607. See also ACID System.Windows.Forms, 1122–1125

1427

bbindex.inddindex.indd 14271427 11/28/10/28/10 1:27:511:27:51 PMPM control templates – CSharpCodeProvider

control templates, 1012–1014 CourseAttendees, 607 for ListBox elements, 1018–1020 CourseDates, 607 controllers (MVC framework), 1260. See also MVC CourseManagement structure, 607 Controllers directory, 1261 CourseOrder, 1370. See also Course Order controlling threads, 499 CourseOrderReceiver, 1379 controls CourseOrderSender, 1379 Web Parts, 1211–1212 CourseOrderService, 1379 Windows Forms, 1122–1125 Courses table, 607 appearance properties, 1123 covariance, 118–120 built-in, 1125–1140 array covariance, 139 custom, 1147 CPOs (connection point objects), 701 miscellaneous functionality, 1125 Create(), 146, 290, 1262 size/location properties, 1123 FileInfo/DirectoryInfo classes and, 774 user controls, 1147 MagicShop.mdf and, 1269–1273 user interaction and, 1124 $create(), 1234 Windows functionality, 1125 CREATE AGGREGATE, 966 WPF, 994–999. See also templates CREATE ASSEMBLY, 956, 963 content, 995–996 CREATE FUNCTION, 970 decoration, 998–999 CREATE PRIMARY XML INDEX, 978 headered content, 996–997 CREATE PROCEDURE, 968 headered item, 998 CREATE TABLE, 972 item, 998 CREATE TRIGGER, 857, 970, 972 simple, 994–995 CREATE XML SCHEMA COLLECTION, controls layer (ASP.NET AJAX Library), 1223 979, 980 ControlTemplate, 1012 CreateEventSource(), 478 conventions. See guidelines; naming conventions; usage CreateFileTransacted(), 565, 632, 633, 634 conventions CreateFromConfi guration(), 300, 301, 302 conversion operators (query operator category), 276, CreateFromFile(), 800 287–288 CreateHardLink(), 723, 724 Conversion Wizard (Visual Studio 2010), 376 CreateHardLinkTransacted(), 632 conversions. See casting CreateInstance(), 134, 135 ConvertAll‹TOutput›(), 25, 236 CreateKeys(), 555, 556 converting ADO.NET data to XML, 927–932 CreateMask(), 260, 261 converting XML to ADO.NET data, 932–934 CreateQuery(), 873, 877 coordinate system (3-D with WPF), 1029–1030 CreateQuery‹T›(), 294 Copy(), 780 CreateResource/Program.cs, 580 Copy Web Tool, 408, 411 CreateSection(), 260, 261 copying/moving/deleting fi les, 780–783 CreateService(), 693 CopyTo(), 208, 226, 774, 780, 798 CreateSubKey(), 810 core services (ASP.NET AJAX Library layer), 1223 CreateSymbolicLinkTransacted(), 632 correlation, 472–475 CreateText(), 774 COUNT, 964, 965 CreateUserWizard, 1204 Count (), 276, 280, 286 CreateXps/DocumentPage.xaml.cs, 1087, 1090, 1091 Count Length, 258 CreateXps/MenuPlannerPage.xaml.cs, 1086 Count property, 237, 240 CreationTime, 773 Course Order (sample application), 1370–1384 Cross(), 145 acknowledgment queues and, 1376–1377 CRUD operations, 954. See also LINQ to XML class library, 1370–1371 cryptography. See encryption entity classes with data contract, 1379–1380 Cryptography Next Generation (cng), 553 message receiver, 1373–1376 CryptoKeySecurity, 559 message sender, 1371–1373 CryptoStream, 557, 558 sending priority/recoverable messages, 1372–1373 Crystal Reports Application, 381 WCF and, 1378–1384 csc command, 24 message receiver application, 1380–1383 CSDL (Conceptual Schema Defi nition Language), 861, message sender application, 1383–1384 864, 865, 866, 867, 868, 884 service contract, 1380 CSharpCodeProvider, 438, 439, 440

1428

bbindex.inddindex.indd 14281428 11/28/10/28/10 1:27:521:27:52 PMPM CSS (cascading style sheets) – data constraints

CSS (cascading style sheets), 1198 WhatsNewAttributes (example), 337–340, 345–349 Ajax and, 1219, 1220 writing, 334–337 ASP.NET and, 1149 custom composite activities, 1319–1322 Content directory and, 1261 custom controls (ASP.NET), 1155, 1192–1195 control styling, 1159 custom controls (Windows Forms), 1147 dynamic data web sites and, 1254, 1255 custom cultures, 601–603 Properties window, 1157, 1159 custom hosting tables v., 1198 with CLR objects, 886–890 themes and, 1206, 1207 WCF and, 1302–1303 Visual Studio 2010 and, 375 custom installation packages. See installation packages CTS (Common Type System), 9 custom interfaces, 697 CTS types, 33–35 custom .NET classes, XAML and, 729–730 bool type and, 35 custom resource managers, 626–632 decimal type and, 34 custom resource messages, 590 fl oating-point types and, 34 custom resource readers, 598–600, 603 integer types and, 33 custom service hosts (WCF), 1287 reference types (predefi ned) and, 35–37 CustomBinding, 1301 CultureAndRegionInfoBuilder, 601–603 CustomCultures/app.manifest, 603 CultureDemo/MainWindow.xaml.cs, 574, 576 CustomCultures/Program.cs, 602 CultureInvariant, 220 customer information (dialog box), 424 cultures Customers table (Northwind database), 832–833, in action, 574–577 874, 875 custom, 601–603 customizing dynamic data web sites, 1255–1259 date formatting and, 573–574 CustomResource/Program.cs, 631 invariant, 571 CustomResource/ResourceManager.cs, 630 neutral, 571 CustomResource/Transactional.cs, 627 number formatting and, 572–573 CustomValidator, 1164 regions and, 570–574 sorting orders and, 578–579 D specifi c, 571 strong names and, 445 D (decimal format), 52, 213 curly braces { } DACL (discretionary access control list), 559 blocks and, 25, 38 daemon processes, 17 if statement and, 38, 39 data access (ADO.NET), 817–860. See also ADO.NET markup extensions and, 741, 742 classes/interfaces for, 818–820 Currency (struct) data reader and, 832–834 Currency to fl oat, 173–174 data adapters Currency to ulong, 180 ambient transactions and, 635 fl oat to Currency, 175–176 DataSet class and, 850–854 currency format (C), 52, 213 stored procedures in, 851 CurrencyStruct, 327, 328, 329 data annotations, 1256 Current property (Transaction class), 611 data binding CurrentAccounts.cs, 104–105 ASP.NET and, 1169–1180 CurrentChangedEventManager, 204 VisualBrush and, 994 CurrentChangingEventManager, 204 WPF, 1035–1051 CurrentCulture, 571–572, 588 to CLR objects, 1040–1045 CurrentFile, 1398, 1399 command binding, 1063, 1073 CurrentUICulture, 571–572, 588 to lists, 1045–1047 Custom Actions editor, 424–426 master detail, 1048 custom activities, 1316–1322 multibinding, 1048–1049 custom attributes, 334–340 priority, 1049–1051 assembly, 436–438 validation, 1057–1061 code access security and, 334 to XAML, 1037–1039 defi ned, 333 to XML, 1055–1057 parameters and, 336–337 data columns, 836–837 preprocessor directives and, 55 data constraints, 842–844

1429

bbindex.inddindex.indd 14291429 11/28/10/28/10 1:27:531:27:53 PMPM data contracts – DataServiceHostFactory

data contracts, 1291 effi cient usage of data display controls, 1162, 1175–1178 try...catch...fi nally blocks, 822–823 with templates, 1176–1178 using clause, 823–824, 860 Data Encryption Standard (DES), 554 database development (ADO.NET) data members, 66–67. See also constants; events; fi elds key generation with SQL Server, 857–858 Data property naming conventions and, 859–860 BitVector member, 260 tiered development, 856–857 System.Exception, 359 DatabaseResourceManager, 600–601 data providers. See also export providers DatabaseResourceReader, 598–600 LINQ, 293–294 DatabaseResourceReaderClient/Program.cs, 601 LINQ to SQL, 818 DatabaseResourceReader/DatabaseResourceManager namespaces and, 818 .cs, 600 ODBC, 818 DatabaseResourceReader/DatabaseResourceReader OLE DB, 818, 832, 834, 850 .cs, 598 in same assembly, 832 DatabaseResourceReader/DatabaseResourceSet.cs, 600 SQL Server, 818, 832, 834, 860 DatabaseResourceSet, 600 TableDirect and, 826 database-specifi c classes (ADO.NET), 819 data query parameters, route parameters and, 1250 DataBind(), 1176, 1191 data reader, 832–834 data-bound controls, 1171, 1178, 1180 data rows, 837–839 DataChangedEventManager, 204 data service context, 886, 896–897, 902 DataColumn, 818, 836, 837, 860 adding/modifying/deleting entities, 900–901 properties, 837 DataServiceContext, 895, 896, 1109 DataColumnMapping, 819 object tracking and, 900 DataGrid control, 998, 1067–1073 operation batching and, 901–902 custom columns, 1069–1070 Data Services. See WCF Data Services grouping with, 1070–1073 data source controls, 1162 row details, 1070 data tables, 835–836 DataGridView control, 1128–1135 objects in, 835 arrays and, 1130–1131 schemas, 835 data sources and, 1130 generation, 839–840 DataTable and, 1131 data template selector, 1053–1055 DataView and, 1131–1133 data templates, 1014–1016 generic collections and, 1134–1135 data tokens, route order and, 1248–1249 IList and, 1134 data triggers, 1010–1011 IListSource and, 1134 data types, 31–33. See also reference types; value types tabular data and, 1128–1130 blittable, 701 DataLib/Formula1.cs, 269–270 COM and, 698 DataLib/Racer.cs, 268–269 data columns and, 836 DataLib/Student.cs, 608 IL and, 8 DataLib/StudentData.cs, 608, 613 nonblittable, 701 DataLib/Team.cs, 269 reference types/value types comparison, 8, 32–33 DataList, 1163, 1175 SQL Server, 818 DataPager, 1163 XAML and, 731 DataReaderExample.cs, 832–833 data web server controls, 1162–1163 DataReaderSql.cs, 834 data display controls, 1162, 1175–1178 DataRelation, 818 data source controls, 1162 DataRelationships.cs, 841 DataAdapter2.cs, 853 DataRow, 818, 860 DataAdapter.cs, 851 version values, 837 Database (project type), 980 DataRowState enumeration, 838, 860 database columns naming conventions, 859 DataServiceBehavior, 889 database connection strings DataServiceConfi guration, 889 format of, 821 DataServiceContext, 895, 896, 1109. See also data managing, 821–822 service context database connections, 820–821, 822–824 DataServiceHost, 889, 890, 1304 closing, 822–824, 860 DataServiceHostFactory, 889, 895

1430

bbindex.inddindex.indd 14301430 11/28/10/28/10 1:27:531:27:53 PMPM DataServiceKey – dependency properties

DataServiceKey, 886, 887, 893 decimal, 34 DataServiceQuery‹TElement›, 895 decimal format (D), 52, 213 DataServicesHost/Category.cs, 887 declarative programming, 19 DataServicesHost/MenuCard.cs, 888 WPF and, 19 DataServicesHost/MenuCardDataModel.cs, 889 declarative role-based security, 547–548 DataServicesHost/Menu.cs, 887 DeclarativeCatalogPart, 1211 DataServicesHost/MenuDataService.cs, 889, 890 decoration controls (WPF), 998–999 DataServicesHost/Program.cs, 890 DecorationsDemo/MainWindow.xaml, 999 DataService‹T›, 886, 888, 889, 895, 1107 Decorator class, 998 DataSet class, 818, 835, 860 decrement operator (--), 151, 153, 154 data relationships, 840–842 deep comparison, 170 EnforceConstraints property, 844, 856 DeepCopy(), 630 persisting DataSet changes, 852–855 default keyword, 113, 114 populating DefaultDocument, 418 with data adapter, 850–851 deferred query execution, 272, 273–275 from XML, 851 #defi ne, 55–56 purpose of, 835 Delay activity, 1314 updating with data adapters, 852–854 delayed loading (of relationships), 876 writing XML output, 854–855 delayed signing (of assemblies), 449–450 DataTable, 818, 860 delegate concatenation/removal operators, 152 DataGridView control and, 1131 delegate inference, 186 deleting rows, 854 delegate keyword, 701 foreign key constraints, 842–843 delegates, 183–197. See also events; Lambda inserting rows, 852–853 expressions primary key restraints, 842 anonymous methods and, 196–197 updating rows, 854 asynchronous, 492–495, 496, 522 DataTableMapping, 819 BubbleSorter example, 190–193 DataTemplate, 1012 declaring, 184–185 DataView, DataGridView control and, 1131–1133 defi ning, 184–185 date formatting, cultures and, 573–574 events and, 183, 184, 200 DatePicker control, 995 generic methods with, 126 Dateservice.cs, 410 instance of, 185, 187 DateTime constructors, 79 Lambda expressions and, 183, 197 DateTimeFormatInfo, 572, 573 multicast, 193–196 DateTimePicker, 1135 simple example, 188–190 DbCommand, 822, 866 using, 185–188 DbConnection, 819, 822, 866, 872 DELETE, 819, 826, 830, 850, 852, 860, 971 DbDataReader, 822, 866 Delete(), 478, 774, 780 DbParameter, 866 delete constraints, 843–844 DbProviderFactories class, 822 DeleteEventSource(), 478 DCOM protocol, 1279, 1280, 1360 DeleteObject(), 873, 900 dead-letter queues, 1363 DeleteSubKey(), 810 deadlocks, 513–514, 543, 1306 DeleteSubKeyTree(), 810 DEBUG preprocessor symbol, 397 DeleteValue(), 810 debugging deleting/moving/copying fi les, 780–783 stepping between languages, 7, 8 DelimitedListTraceListener, 470, 471, 472 Visual Studio 2010, 375, 398–401 delivery modes (messages), 1361 breakpoints, 398–399 demanding permissions programmatically, debugger symbols, 396 564–565 design-time debugging, 374, 388 DemandPermissionDemo/DemandPermissions.cs, 564 exceptions, 400–401 DemoLib/AssemblyInfo.cs, 730 release builds, 395–396 DemoLib/Person.cs, 729 watches, 375, 399–400 DemoSolution, 385, 389 XSLT, 925–927 dependency properties, 732–736, 739 DebugWrite, 1316, 1317, 1318, 1319 attached properties v., 739 DecelerationRatio, 1022 coerce value callback and, 734–735

1431

bbindex.inddindex.indd 14311431 11/28/10/28/10 1:27:541:27:54 PMPM dependency properties – division operator

dependency properties (continued) DictionarySample/Employee.cs, 252 creating, 733–734 DictionarySample/EmployeeId.cs, 251 taskbar and, 1412 DictionarySample/Program.cs, 252 value changed callbacks and, 735–736 Dictionary‹TKey, TValue›, 248, 250, 252, 266, 287 DependencyObject, 986 Dictionary.xaml, 1007 DependencyObjectDemo/MyDependencyObject.cs, DiffuseMaterial, 1030 733, 734, 735, 736, 739 digital certifi cates. See certifi cates dependent transactions, 616–618 dimension (rank), 132, 134, 136 DependentClone(), 612, 617, 623 Dimensions class, 80, 81 DependentServices, 685 directories DependentTransaction, 611, 616, 623, 636 folders v., 772 deployment (application deployment), 407–427 reading ACLs from directory, 803–804 ClickOnce technology, 408, 419–422 Directory class, 772, 773, 780 of CLR, 409 directory structure (Windows 7), 1406–1407 Copy Web Tool and, 408, 411 DirectoryCatalog, 751, 753, 767, 768 options, 408, 409–410 DirectoryInfo, 772, 774, 776, 778, 779, 783, 784, 787, planning for, 407–409 804, 808 requirements, 408–409 methods, 774 xcopy, 408, 410–411, 412, 452 properties, 773–774 deployment manifest, 419, 420–421 DirectoryName (FileInfo), 773 deployment projects, 408, 412 DirectorySeparatorChar, 775 Dequeue(), 236, 237, 238, 265 DirectoryServicesPermission, 562, 563 dereference operator. See indirection operator dirty reads, 625, 626 derived classes disconnected record set, 817, 818, 819 base classes to derived classes (casting), 177–178 discount application (shopping cart application), constructors of, 94–98 300–302 derived interfaces, 104–105 discovering peers, 1353 DeriveKeyMaterial(), 557 discovery, P2P and, 1341–1342 DES (Data Encryption Standard), 554 discretionary access control list (DACL), 559 Descendants(), 293 dispatch interfaces, 697 Description (project property), 414 DispatcherObject, 986 Deserialize(), 934, 938 DispatcherTimer, 487, 488, 533, 1400, 1401 design view editor, 374, 388 DispId attribute, 717 Design View window, 388–391 Display(), 118 design-by-contracts, 461. See also code contracts DisplayAllDocuments(), 115 Designer rehosting, 1332–1337 DisplayAllNodes(), 245 designers (for activities), 1317–1319 DisplayFile(), 792, 797, 798 design-time debugging, 374, 388 DisplayFolderList(), 778, 779, 780, 783 destruction/instantiation, of forms, 1142–1145 displaying output as HTML page (WebBrowser destructors, 313–314 control), 643 as fi nalizers, 313 DisplayName IDisposable and, 315–317 ServiceController class, 685 Detach(), 873, 882 ServiceInstaller class, 682 detaching/attaching entities, 882 DisplayTabularData application, 1128–1130 Details(), 1262, 1268 DisplayTree(), 292 DetailsView, 1163, 1175 DisplayTypeInfo(), 347 DetectNewerInstalledVersion, 414 Dispose(), 82, 100, 101, 141, 314, 315, 316, 317, 357, DHTML (Dynamic HTML), 18, 1220, 1221 618, 619, 823 dialog boxes, for projects, 424 Distinct(), 276, 283, 878 dictionaries (hash tables, maps), 248–254 Distributed Routing Table (DRT), 1345–1346 GetHashCode() and, 84, 147, 162, 170, 248, 249, Distributed Transaction Coordinator (DTC), 611, 616 250, 251, 284 distributing code, with certifi cates, 567–568 key type, 248–250 Divide(), 146, 147 lookup and, 253–254 division operator, 157 sorted, 254 division operator (/, %), 151, 152, 153, 157

1432

bbindex.inddindex.indd 14321432 11/28/10/28/10 1:27:551:27:55 PMPM “DLL Hell,” – DynamicObject

“DLL Hell,” 21, 459 downloading fi les (with WebClient class), 638–639 DllImport, 100, 317, 633, 723, 724 DrawingBrush, 992–993 extern modifi er, 100 drive information, reading, 800–802 properties/fi elds, 724 DriveInfo class, 772, 800, 801 DLR (), 295, 305 DriveViewer.sln, 801 CLR and, 295 DropDownList, 1160 open-source version of, 295 DRT (Distributed Routing Table), 1345–1346 ScriptRuntime, 300–302 DSA algorithm, 554 Silverlight and, 295 DTC (Distributed Transaction Coordinator), 611, 616 Dns class, 655 dual interfaces, 697–698 DNS names. See IP addresses duplex communication, 1301, 1306–1308 DnsLookup example, 655–656 durability (ACID), 607. See also ACID DNSLookupResolver, 655 Duration (Timeline property), 1022 DnsPermission, 562 DWORDs, 320 DockPanel, 1001 dynamic data (ASP.NET), 1243, 1251–1259, 1274. . See DOM See also ASP.NET MVC; routing document window (Visual Studio), 376, 398, 402, 405 ASP.NET MVC and, 1243 DocumentManager class, 238 controls, 1162, 1163 DocumentManager/Document.cs, 115 templates, 1251, 1257 DocumentManager/DocumentManager.cs, 114, 115 directories, 1257 DocumentManager/Program.cs, 116 Dynamic Data Entities Web Site, 380, 1251 DocumentManager‹T›, 114, 115, 116 Dynamic Data Linq to SQL Web Site, 380, 1251 documents (WPF), 1075–1094 dynamic data web sites anchor to blocks, 1083–1084 creation, 1251–1255 Block elements, 1080–1081 adding data source, 1252 fi xed documents, 1075, 1086–1089 choosing data access model, 1251–1252 fl ow documents, 1075, 1085 confi guring scaffolding, 1252–1253 fonts, 1075–1077 CSS and, 1254, 1255 Inline elements, 1078–1080 customizing, 1255–1259 lists, 1081–1082 DynamicValidator and, 1164 printing, 1091–1093 LINQ to SQL and, 1251, 1252, 1256, 1260, 1261, tables, 1082–1083 1262, 1274 text elements, 1075–1084 Dynamic HTML (DHTML), 18, 1220, 1221 TextEffect, 1077–1078 dynamic keyword XPS documents, 1089–1091 COM binder and, 709 DocumentViewer, 1086, 1091 Foo property and, 755 DoEvents, 1119 refl ection and, 754 DoLongTask(), 540, 541 dynamic language extensions, 295–305 DOM (Document Object Model), 903, 1219. See also COM servers with, 709 XmlDataDocument; XmlDocument DLR ScriptRuntime and, 300–302 Ajax and, 1219 Dynamic Language Runtime. See DLR Level 1/Level 2, W3C and, 904, 913 dynamic programming, 295, 305 .NET Framework and, 913–917 dynamic resources (WPF), 1005–1006 XmlNode and, 905, 906, 913, 915, 917, 928, 974 dynamic type, 296–300, 305 XmlNodeList and, 905, 913, 914, 915 behind the scenes, 297–300 DomainTest/Program.cs, 442, 443 IL and, 297–299 DotnetClient/Program.cs, 708, 712 limitations of, 297 DotnetServer/DotnetServer.cs, 714, 717, 720 DynamicAssembly/CodeDriver.cs, 438–440, 444 double, 34 DynamicAssembly/CodeDriverInApp double quotation marks (“) Domain.cs, 444 escape sequence for, 35 DynamicAssembly/DynamicAssemblyWindow.xaml string literals and, 37 .cs, 440, 444 DoubleMain.cs, 48–49 DynamicClass, 297, 298 do...while loops, 42 DynamicDotnetClient/Program.cs, 709 DownloadData(), 639, 642 DynamicHyperLink, 1160 DownloadFile(), 638 DynamicObject, 302–304

1433

bbindex.inddindex.indd 14331433 11/28/10/28/10 1:27:551:27:55 PMPM DynamicPartitionerForArray‹TSource› – equality

DynamicPartitionerForArray‹TSource›, 290 signature and, 554–556 Dynamic/Program.cs, 296, 303 System.Security.Cryptography classes, 553, 554, 555, DynamicResource, 1006, 1007 556, 969 DynamicValidator, 1164, 1257 WCF and, 545 EndEdit(), 837, 838, 839 E EndExecute(), 1109 EndGetResponse(), 642 eager loading (of relationships), 876 #endif, 56–57 early binding, 21, 698 EndInvoke(), 494 ease functions, 1023, 1025, 1099, 1100 EndOfStreamException, 353 EasingDoubleKeyFrame, 1026 #endregion, 57, 387, 1120 Easy Connect, 1346 EnforceConstraints property, 844, 856 ECDiffi eHellman, 554, 556, 557, 558 enlist methods (Transaction class), 611 ECDiffi eHellmanCng, 554, 557, 558 EnlistDurable(), 611, 626 ECDSA algorithm, 554–555 EnlistPromotableSinglePhase(), 611 echo service, 661 EnlistVolatile(), 611, 626 EDI (Electronic Data Interchange), 19 Enqueue(), 236, 237, 238, 262, 263, 265 Edit(), 1262, 1273–1274 Ensures(), 464, 465 ‹EditItemTemplate›, 1177 EnsuresOnThrow‹TException›, 464 editor application (WPF example), 1398–1403 Enterprise Manager (SQL Server), 858 EditorDemo/App.xaml.cs, 1400 Enterprise Services (online Chapter 51), 609, EditorDemo/CurrentFile.cs, 1399 610–611 EditorDemo/MainWindow.xaml.cs, 1401 AutoComplete attribute and, 610, 1294 tracing and, 1399 automatic transactions, 610, 611, 636, 1279 editors, Visual Studio 2010, 422–427 WCF and, 1303, 1308 EditorZone, 1211 entity classes (ADO.NET Entity Framework), 868–871 EDM (Entity Data Model), 862, 866, 885, 975, 1102, attaching/detaching, 882 1162, 1262, 1282, 1390 classes/interfaces and, 870–871 ASP.NET hosting and, 894–895 LINQ to Entities, 883–884 Designer, 864 relationships, 873–876 Silverlight networking example, 1102 storing changes, 882–883 E/e (scientifi c (exponential) format), 52, 213 Entity Client, 866–867 Eiffel programming language, 461 Entity Data Model. See EDM Electronic Data Interchange (EDI), 19 Entity Framework. See ADO.NET Entity Framework element operators (query operator category), 276 Entity SQL, 862, 867–868 ElementAt, 276 EntityCommand, 862, 866 ElementAtOrDefault, 276 EntityConnection, 862, 866, 871 Elements(), 293 EntityDataReader, 862, 866, 867 #elif, 56–57 EntityDataSource, 1162 Ellipse class, 987 EntityObject, 868, 870, 871, 875, 881 EllipseGeometry, 988 EntityParameter, 866 #else, 56–57 Entries property, 477 else if statements, 38 EntryPoint, 724 else statements, 37, 38. See also if statements Enumerable class, 272, 273, 275, 288, 289, 291, 294. ElseIf.cs, 38 See also extension methods; query operators e-mail for application-to-application communication, EnumerableSample/Program.cs, 277, 279, 281, 1358. See also Message Queuing 283, 287 EmissiveMaterial, 1030 enumerations, 44–45, 140–146. See also specifi c Empty(), 276, 288, 289 enumerations ‹EmptyDataTemplate›, 1178 foreach statement and, 140, 141 ‹EmptyItemTemplate›, 1178 naming conventions, 60–63 EnableVisualStyles, 1119 enumerators, yield return and, 145–146 Encoding.ASCII class, 661 Enum.Parse(), 45 encryption, 552–558, 568 EnvironmentPermission, 562 CLR classes and, 969, 980 equality

1434

bbindex.inddindex.indd 14341434 11/28/10/28/10 1:27:561:27:56 PMPM Equals() – Export attribute

comparing reference types for equality, 162–163 delegates and, 183, 184, 200 comparing value types for equality, 163 .NET Framework and, 701 Equals(), 84–85. See also comparison operators synchronization and, 526–529 ReferenceEquals() and, 84, 162, 163 tunneling, 201, 736–739 static, 162 weak, 203–205 virtual, 162 EventSample/Calculator.cs, 528 #error, 57 EventSample/Program.cs, 526, 527, 529 Error Reporting. See EventSourceCreationData, 478–479 ErrorProvider component, 1135–1136 EventsSample/CarDealer.cs, 200 errors, 351. See also exceptions EventsSample/Consumer.cs, 202 COM and, 700 EventsSample/Program.cs, 202 StateService sample and, 1298–1299 EventTypeFilter, 472 escape sequences, 35, 218, 221 Everything (permission set), 564 Eve/Bob/Alice (encryption example), 553 ‹example›, 53 event bubbling. See events Except(), 276, 283, 878 event keyword, 701 ‹exception›, 53 event listener, 202–203 exception classes, 352–353 Event Log service, 668 user-defi ned, 362–369 event logging, 461, 475–483, 692–693 exception handling, 351 architecture, 476–477 exceptions, 13, 351–369 classes, 477–478 C++ and, 351 message resource fi les, 479–483 catching, 353–359 writing event log entries, 479 class hierarchy for, 352, 353 event manager classes, 204 debugging and, 400–401 event publisher, 200–201 exceptional circumstances for, 355, 356, 359 event source, 478–479 nested try blocks and, 360–362 event triggers, 1020, 1023–1025 .NET Framework and, 700 , 461, 475, 476, 477, 479, 482, 483 One() and, 195 event-based asynchronous component, 539–543 performance and, 351 event-based asynchronous pattern, 534–543, 1106, throwing, 354 1109, 1293 unhandled, 360 event-booking example (ASP.NET server control), user-defi ned, throwing, 364–367 1164–1169 ExecutablePath, 1118 updating, 1169–1175 Execute(), 1061, 1312 EventHandler‹T›, 201, 202 ExecuteCommand(), 690 event-handling architecture (COM), 701 ExecuteNonQuery(), 826–827, 830, 832 EventLog class, 475, 477–479, 482 ExecutePermissions, 418 members, 477–478 ExecuteReader(), 826, 827, 832, 833 EventLogDemo/EventLogDemoMessages.mc, 481 ExecuteReaderExample.cs, 827, 828, 829 EventLogDemo/Program.cs, 478, 479, 483 ExecuteScalar(), 826, 828, 832 EventLogEntry, 477 ExecuteXmlReader(), 826, 828–829, 860 EventLogInstaller, 475 Execution (permission set), 563 EventLogPermission, 562 execution process (.NET Framework), 21–22 EventLogTraceListener, 470, 475, 477 Exists(), 463 EventManager, 738 Exists property, 773 EventRegistration (Silverlight Navigation Application), Exit, 1119 1097 ExitThread, 1119 creation, 1097 Expander control, 997 navigation, 1097–1101 ExpanderDemo/MainWindow.xaml, 997 tables, 1102 ExpandoObject, 304, 741 EventRegistrationDataService, 1107, 1108 explicit casting, 159–161, 172–173. See also EventRegistration/Home.xaml.cs, 1109, 1110 user-defi ned casts events, 67, 184, 200–205. See also delegates; Lambda ExplicitCapture, 220 expressions exponential format (E/e), 52, 213 bubbling, 201, 736–739 Export attribute, 748, 750, 754, 757, 759, 762

1435

bbindex.inddindex.indd 14351435 11/28/10/28/10 1:27:571:27:57 PMPM export providers – fi nished (dialog box)

export providers, 765–767 File Types editor, 423 containers and, 765–767 FileAccess enumeration, 789 purpose of, 765 FileAccessControl/Program.cs, 560 exports (MEF), 749, 755–762 FileDialogPermission, 563 exported metadata, 760–762 FileInfo, 772, 774, 777, 778, 779, 780, 787, 790 exported properties/methods, 759–760 methods, 774 express delivery mode (messages), 1361 properties, 773–774 Expression Blend, 727 FileIOPermission, 562, 563, 564, 724 expression builders, route parameters and, 1250 FileMode enumeration, 789 Expression class, 200, 292 FileNotFound, 362, 363, 364 Expression Design, 727 FileProperties (sample application), 775–780 expression trees, 291–293 FilePropertiesAndMovement (sample application), Expression‹T›, 200, 291, 292, 293 780–783 ExpressionTreeSample/Program.cs, 291 FilePropertiesAndMovement.sln, 781, 782, 783 extender controls, 1232–1233 FileProperties.sln, 777, 778, 779, 780 ExtenderControl, 1223, 1232–1233 fi les. See also fi le system Extensible Application Markup Language. ACLs See XAML adding/removing ACLs from fi les, 805–806 Extensible Markup Language. See XML reading ACLs from fi le, 802–803 extension methods, 86–87 folders and, 772 dynamic type and, 297 mapped-memory fi les, 799–800 LINQ, 272–273 moving/copying/deleting fi les, 780–783 MEF implementation and, 748, 751, 764, 765 reading/writing to fi les, 784–787 this keyword and, 87, 272 binary fi les, 789–793 Extension property, 773 text fi les, 793–799 extensions, workfl ows and, 1325–1326 security, 771, 802, 814 extern (modifi er), 100 FileSecurity class, 559, 560, 803, 805 external (safety level), 956 FileShare enumeration, 789 FileStream, 365, 559, 634, 787 F in hierarchy of stream-related classes, 788 reading/writing to binary fi les with, 789–793 F (fi xed-point format), 52, 213 FileStreamSecurity, 559 F# (programming language) FileSystemAccessRule class, 560, 561, 569, 803, 804, Chapter 53 (C#, Visual Basic, C++/CLI, and F#) and, 805 7, 726 FileSystemInfo, 772, 774 tuples and, 146 FileSystemTransactions/IKernelTransaction.cs, 634 fall-through behavior, 39, 40 FileSystemTransactions/NativeMethods.cs, 633 FancyButtonStyle, 1004 FileSystemTransactions/SafeTransactionHandle.cs, 633 fat-client applications, 19 FileSystemTransactions/TransactedFile.cs, 635 Fiddler tool, 1239 FileSystemWatcher, 768 FieldName attribute, 334, 335, 336 FileUpload, 1161 fi elds (member variables), 29, 66 FillBehavior, 1022 /local variables, scope clashes for, 30–31 fi ltering operators (query operator category), 275, structs and, 81 277–278 underscore and, 73 fi lters, 467, 471–472 usage guidelines, 64 Finalize(), 85, 313, 314 FIFO (fi rst in, fi rst out), 236, 266 fi nalizers, 67. See also constructors; destructors Figure, Floater v., 1084 constructors v., 67 fi le: identifi er, 638 as destructors, 313 File object, 784, 803 fi nally blocks, 13, 353–355 FILE protocol, 653 Find(), 232, 233, 242 fi le system. See also fi les FindIndex(), 232, 233 exploring/managing, 771–780 FindLast(), 232, 233, 242 fi le manipulation. See fi les FindLastIndex(), 232, 233 registry v., 806, 807 FindResource(), 1006 File System editor, 415, 418, 422, 424, 425 fi nished (dialog box), 424

1436

bbindex.inddindex.indd 14361436 11/28/10/28/10 1:27:581:27:58 PMPM Finnish sorting (example) – functions

Finnish sorting (example), 578 ForeignKeyConstraint, 842, 843 First (element operator), 276 Form class, 1142. See also forms fi rst C# program, 23–25 form feed (escape sequence), 35 fi rst in, fi rst out (FIFO), 236, 266 Form1.cs, 389, 1119, 1120, 1121 First.cs, 24 Form1.cs (code snippet), 1119 FirstOrDefault, 276 Form1.Designer.cs, 389, 1119, 1120, 1121 fi xed documents, 1075, 1086–1089 Form1.Designer.cs (code snippet), 1120 fi xed keyword, 324, 328 Format(), 198, 208 FixedDocument class, 1086, 1087 format specifi ers, 52, 213 fi xed-point format (F), 52, 213 format strings, 52, 212–217 fl ags (DataRowState enumeration), 838 FormatException, 359, 360, 365 fl oat, 34 FormattableVector, 216–217 casting FormBorderStyle, 1145 Currency to fl oat, 173–174 forms (Windows Forms), 1142–1146. See also Windows fl oat to Currency, 175–176 Forms fl oat to long, 179 appearance, 1145–1146 fl oat to uint, 175 Form class and, 1142 uint to fl oat, 174 instantiation/destruction, 1142–1145 Floater, Figure v., 1084 Forms Authentication, 548, 551, 1201, 1202 fl oating-point types, 34. See also double; fl oat Formula-1 champions fl ooding, 1342 collections and, 227–229 fl ow control, 37–44 LINQ queries and, 267–286 fl ow documents, 1075, 1085 sets and, 255 FlowDocument class, 1085 Formula1 class, 269 FlowDocumentDemo/FlowDocument1.xaml, 1079 Formula-1 sample database FlowDocumentDemo/FlowDocument2.xaml, 1080 Syndication Feeds sample, 1390–1394 FlowDocumentDemo/ListDemo.xaml, 1082 WPF, 1063–1073 FlowDocumentDemo/ParagraphDemo.xaml, 1081 custom columns, 1069–1070 FlowDocumentPageViewer, 1085 DataGrid control, 1067–1069 FlowDocumentReader, 1085 grouping with DataGrid control, 1070–1073 FlowDocumentsScrollViewer, 1085 mapping for, 1063–1064 FlowLayoutPanel, 1138–1139 row details, 1070 folders TreeView control, 1063–1067 defi ned, 772 Formula1Demo/Program.cs, 877, 879, 880, 882, directories v., 772 883, 884 .NET classes for. See Directory class; DirectoryInfo FormView, 1163, 1175, 1178–1179 folding editor feature, 386–388 Frame control, 995, 996 FontFamily, 1075, 1076 FrameDemo/MainWindow.xaml, 996 fonts, 1075–1077 FrameworkElement, 986, 1006 FontSize, 1003, 1075, 1076 freeing unmanaged resources, 312–313 FontStretch, 1075, 1076 frmADOXML.cs, 927, 928, 929, 931, 932 FontStyle, 1075, 1076 frmNavigator.cs, 919, 920, 921 FontWeight, 1075, 1076 frmSerial.cs, 935, 937, 938, 939, 940, 941 Foo(), 126, 127, 128, 272, 473, 474 frmXMLDOM.cs, 914, 915 Foo property, 754, 755 from clause, compound, 278, 283 ‹FooterTemplate›, 1177 from query, compound, 288 for loops, 40–42 FuelEconomy/FuelCalculatorExtension.cs, 758 nested, 41–42 FuelEconomy/FuelEconomyUC.xaml.cs, 758 Parallel.For() and, 504–506 FullName property, 773 ForAll(), 463, 464 FullTrust (permission set), 563 foreach loops, 43 fully qualifi ed name, 46 enumerations and, 140, 141 Func‹T›, 190, 759 IEnumerable/IEnumerator interfaces and, 140–141 function members, 67. See also constructors; fi nalizers; Parallel.ForEach() and, 506–507 indexers; methods; operators; properties foreign key constraints (DataTable), 842–843 functions

1437

bbindex.inddindex.indd 14371437 11/28/10/28/10 1:27:581:27:58 PMPM functions – GetQuoteOfTheDay()

functions (continued) GenericPrincipal, 546 abstract, 93 generics, 107–128 anonymous. See anonymous methods; Lambda binary code reuse and, 109 expressions casting and, 113 calling base versions of functions, 93 code bloat and, 109–110 methods v., 67 default keyword and, 114 pure virtual, 93 naming guidelines, 110 overview, 107–110 G performance and, 108 type safety and, 107, 109 G (general format), 52, 213 XAML and, 728, 732, 744 GAC (), 15, 446–447 geometries (WPF), 988–989 gacuil.exe, 446–447, 456, 457 GeometryDemo/MainWindow.xaml, 988 GameMoves, 145, 146 GeometryDrawing, 992 garbage collection, 10–11, 311–312 GeometryGroup, 992 CLR and, 312 Get(), 258 freeing unmanaged resources and, 312–313 $get(), 1234 memory management and, 303, 696 get accessor, 732, 733 GC class, 312, 317 GetAccessControl(), 559, 560, 803, 804, 805, 810 general format (G), 52, 213 GetAssemblies(), 444 generation operators (query operator category), 276, GetAStringDemo/Currency.cs, 187 288–289 GetAStringDemo/Program.cs, 185–186 generic classes, 110–118, 225–226 GetChampions(), 269, 278, 284 constraints, 114–116 GetChanges(), 856 creating, 110–113 GetChildRows(), 839, 841 default values, 114 GetConstructor(), GetConstructors(), 342 features, 113–118 GetConstructorChampions(), 270, 282 generic types and, 107 GetCustomAttributes(), 345, 348 inheritance and, 117 GetCustomerOrdersCLR, 968 keywords and, 113, 114 GetDatabaseConnection.txt, 822, 827 static members of, 117–118 GetDefaultMembers(), 342 generic collection classes, 108. See also collections GetDirectories(), 774, 778, 783 DataGridView control and, 1134–1135 GetDocument(), 114, 238, 245 IEnumerable‹T› and, 112, 125, 226 GetDrives(), 801 non-generic collection classes and, 108, GetEnumerator(), 110, 111, 112, 113, 118, 134, 140, 225, 732 141, 142, 143, 144, 226 ObservableCollection‹T›. See ObservableCollection‹T› GetEvent(), GetEvents(), 342 System.Collections.Generic and, 108, 109, 578 GetField(), GetFields(), 342 XAML and, 732 GetFileNames(), 814 generic interfaces, 118–123 GetFiles(), 774, 778, 783 contra-variance with, 118–123 GetFileSystemInfo(), 774 covariance with, 119–120 GetFormat(), 572 generic methods, 123–128 GetHashCode(), 84, 147, 162, 170, 248, 249, 250, with constraints, 125–126 251, 284 with delegates, 126 GetHostByAddress(), 655 specialization, 126–128 GetInvocationList(), 196, 201 generic types GetManifestResourceNames(), 581 generic classes and, 107 GetMember(), GetMembers(), 342 naming guidelines for, 110 GetMenusByName(), 890 null and, 113, 114 GetMethod(), GetMethods(), 342 GenericConsumer, 95, 96, 97, 98 GetNextTextElement(), 570 GenericMethods/Account.cs, 124, 125 GetObjectByKey(), 873, 882 GenericMethods/Algorithm.cs, 125, 126 GetParentRows(), 841, 842 GenericMethods/IAccount.cs, 125 GetProperty(), GetProperties(), 342 GenericMethods/Program.cs, 124, 126, 127 GetQuoteOfTheDay(), 447, 449

1438

bbindex.inddindex.indd 14381438 11/28/10/28/10 1:27:591:27:59 PMPM GetResponse() – hosting

GetResponse(), 640, 641, 642, 652 hash tables. See dictionaries GetSubKeyNames(), 810 HashSet‹T›, 255, 265, 266 GetTextElementEnumerator(), 570 Hashtable, 584 GetTransactedFileStream(), 634 header fi les (C++), 47 GetType(), 85, 340 headered content controls (WPF), 996–997 GetUI(), 754, 757, 766 headered item controls (WPF), 998 GetValue(), 134, 628, 629, 733, 739, 810 HeaderedContentControl, 996–997 GetValueKind(), 810 HeaderTemplate, 996 GetValueNames(), 810 ‹HeaderTemplate›, 1177 global assembly cache. See GAC heaps (managed heaps) Global Assembly Cache Viewer, 448 arrays on, 329 global clouds, 1344 defi ned, 8, 32, 309 global utility functions (ASP.NET AJAX Library), 1234 garbage collection and, 311–312 Global.asax, 1261 memory allocation on, 309–311 globalization. See also localization reference data types and, 8, 32, 309–311 cultures and regions. See cultures structs and, 80, 87 defi ned, 569 Hello World examples sorting orders and, 578–579 HelloCollection, 142, 143 Unicode issues, 570 Workfl ow 4, 1310–1311 globally unique identifi er. See GUID HelpLink (System.Exception), 359 GoBack(), 649 hexadecimal format (X), 52, 213 GoForward(), 649 hexadecimal values, char and, 35 GoHome(), 649 HiddenField, 1161 GoldAccount, 103, 104 hiding methods, 92–93 goto statements, 39, 40, 43 HierarchicalDataTemplate, 1012 Graphics with GDI+ (online Chapter 48), 77 hierarchies. See also class hierarchy graphs. See clouds classes and, 113 GregorianCalendar, 569, 576, 1090 constructors in, 96–97 Grid, 1001–1002 constructors with parameters in, 97–98 GridView, 1163, 1175 CTS and, 9 GroupBox control, 997 fi le system. See fi le system GroupBy, 276 registry, 806. See also registry GroupBy(), 280, 281, 878 resources (WPF) and, 1005 grouping operators (query operator category), 276, stream-related classes, 787–788 280–281 task, 502–503 GroupJoin operator, 276 WebRequest/WebResponse classes, 652–653 groups (regular expressions), 223–224 highCostMinutesUsed, 95 ‹GroupSeparatorTemplate›, 1178 HisBaseClass, 92, 93 ‹GroupTemplate›, 1178 hives, registry, 807 GUID (globally unique identifi er), 621 HKEY_CLASSES_ROOT, 422, 718, 807 Guid attribute, 716 HKEY_CURRENT_CONF, 807 guidelines HKEY_CURRENT_USER, 422, 467, 807, 808 C# programming, 58–64 HKEY_DYN_DATA, 807 usage HKEY_LOCAL_MACHINE, 422, 476, 477, 679, 807, fi elds, 64 808, 809 methods/properties, 64 HKEY_LOCAL_ Windows 7/Windows Server 2008, 1397–1415 MACHINESystemCurrentControlSetServices, 679 guidgen.exe utility, 704, 716, 1363 HKEY_PERFORMANCE_DATA, 807 HKEY_USERS, 422, 807 H host classes, preconfi gured, 1303–1304 host names. See IP addresses Hamlet.xml, 943, 948, 949, 951, 952, 953 hosting hand-coded schema, 839–840 with CLR objects, 886–890 handlers (service program), 669 DLR ScriptRuntime, 300–302 hash algorithms, 554 WCF and, 1302–1304

1439

bbindex.inddindex.indd 14391439 11/28/10/28/10 1:28:001:28:00 PMPM hosting – IListSource, DataGridView control

hosting (continued) COMServer.idl, 696 Workfl ow Designer, 1332–1337 fi les, 696, 703, 705, 714 workfl ows, 1327–1332 IEnlistmentNotifi cation, 626–627, 636 HostProtectionAttribute, 956 IEntityWithChangeTracker, 870, 871 HTML (Hypertext Markup Language), 1219 IEntityWithKey, 870, 871, 873, 881 HTML page output (WebBrowser control), 643 IEntityWithRelationships, 870, 871, 875, 876 HTML server controls (ASP.NET), 1155 IEnumerable, 43, 112, 140–141 http: identifi er, 638 IEnumerable‹out T›, 117, 118 HTTP client application (Data Services), 891–893 IEnumerable‹T›, 112, 125, 226 HTTP protocol, 637, 638, 640, 641, 642, 652, 656, IEnumerable‹TSource›, 270, 273, 279, 280, 289, 294 657, 658 IEnumeration‹T›, 761 https: identifi er, 638 IEnumerator, 112, 131, 140–141 HTTPS protocol, 653 IEnumerator‹out T›, 118 HttpWebRequest, 495, 641, 652, 891, 895, 1109 IEnumerator‹T›, 112, 141 HttpWebResponse, 641, 652, 891 IEqualityComparer, 148, 149 Hungarian notation, 60, 102 IEqualityComparer‹T›, 148, 226, 250, 284 Hyperlink control, 1160 IExtensibleObject‹T›, 118 Hypertext Markup Language. See HTML #if, 56–57. See also Conditional attribute If activity, 1312–1313 I if statements, 37–39 if...else construction, 37, 154. See also conditional IAccount interface, 125, 126 operator IANA (Internet Assigned Numbers Authority), 658 IFormattable interface, 84, 207, 212, 214, 215, 216, IAsyncResult, 493, 494, 495, 642, 643, 1312 227, 231, 268, 339, 349 IBankAccount, 101–102, 103, 104 IgnoreCase, 220 ICalculator interface, 749, 750, 751, 759, 762, 764, 765 IgnorePatternWhitespace, 220 ICalculatorExtension, 754, 757, 758, 763, 765, 767 IIdentity interface, 546, 568 ICloneable, 135 IIndex‹T›, 120 ICollection‹T›, 118, 226, 232, 236, 255 IIS (Internet Information Server) IComparable interface, 118, 136, 137, 138, Administrator tool, 411, 419 139, 149, 234 ASP.NET and, 409, 1150, 1152, 1157 IComparable‹Racer›, 268 properties, 418, 419 IComparable‹T›, 118, 227, 234 WCF hosting and, 1302, 1303 IComparer interface, 137, 138, 139, 149 World Wide Web Publishing Service, 668 IComparer‹T›, 137, 226, 234 IJW (It Just Works), 726 ICompletedEvents, 701, 710, 711 IKernelTransaction, 633, 634 IConnectionPoint, 701, 713 IL (Microsoft Intermediate Language), 4, 6–13 IConnectionPointContainer, 701, 711, 713 advantages of, 4 identifi ers case sensitivity, 9 case sensitivity of, 58 dynamic type and, 297–299 keywords as, 58–59 features of, 6–13 rules for, 58–59 generics and, 107 identity, principal and, 545–547 interfaces and, 7 IDENTITY columns, 857, 858 Java byte code v., 4 IdentityReference, 559 language interoperability and, 5–6, 7–8 IDictionary‹TKey, TValue›, 226 .NET Framework and, 6 IDispatch, 697, 698, 705, 707, 709, 721 object-oriented programming and, 7 IDisplay‹T›, 121 performance improvement and, 4–5 IDisposable (System.IDisposable), 100, 101, 313, platform independence and, 4 314–315 strong data typing and, 8–13, 157 database connections and, 823, 824, 860 type safety and, 11, 12 destructors and, 315–317 ildasm tool, 14, 297, 434, 435, 448, 449, 581, 588 freeing unmanaged resources with, 314–317 IList, 226, 230, 276 IDL (Interface Defi nition Language) DataGridView control and, 1134 attributes and, 13 IListSource, DataGridView control and, 1134

1440

bbindex.inddindex.indd 14401440 11/28/10/28/10 1:28:001:28:00 PMPM IList‹T› – interfaces

IList‹T›, 226, 230, 236, 290 inlining, 74 ILookup‹TKey, TValue›, 226 InnerException (System.Exception), 359, 362 Image control, 1160 INotifyPropertyChanged, 868, 870, 881, 896, 1036, ImageBrush, 993 1042, 1334 ImageButton, 1160 INotifyPropertyChanging, 868, 870 ImageList component, 1136 In/Out (attributes), 717 ImageMap, 1160 input string, 219 IMath interface, 697, 704, 706, 707, 708, 715, 717, 719 INSERT, 819, 860, 971 immutable, strings as, 36, 70, 209 Insert(), 208, 230 implementation inheritance, 89, 90–98 inserting nodes (XmlDocument class), 915–917 implicit casting, 158–159. See also user-defi ned casts ‹InsertTemplate›, 1177 implicit permissions, 566–567 Install(), 679, 680, 683 ImplicitPermissions/Program.cs, 567 InstallAllUsers, 414 Import attribute, 748, 750, 751, 759, 765, 767 installation address (dialog box), 424 import statement (Java), 25 installation folder (dialog box), 424 ImportCatalogPart, 1211 installation packages, creating, 413 ImportMany attribute, 761, 763 for client applications, 413–417 imports (MEF), 749, 762–765 installation program (Quote service), 679–683 in keyword, 120 Installer class, 680 Include(), 876, 878 installer project types (Visual Studio 2010), ‹include›, 53 408, 412 IncludeExceptionDetailInFaults, 1295 installutil.exe, 680, 682–683 Increment(), 487, 520 instance, of delegate, 185, 187 increment operator (++), 151, 153, 154 instance fi eld, 31 Index(), 1262, 1263, 1267, 1268 InstanceContextMode, 1294 Index (project property), 418 instantiation/destruction, of forms, 1142–1145 index operator [ ], 152, 172 instrumentation, 461–489 indexers, 67 code contracts, 461–466 array elements and, 130–131 event logging, 475–483 indexes, XML, 978–979 performance monitoring, 483–489 IndexOf(), 208, 232, 233 tracing, 467–475 IndexOfAny(), 208 insurance policy example, 1322 IndexOutOfRangeException, 131, 354, 355, int, 33 356, 357, 358, 359, 360 integer types indirection operator (*), 152, 319 implicit conversions, 158–159 InDoubt(), 627 predefi ned, 33 inheritance, 89–105 user-defi ned. See enumerations generic classes and, 117 integrity, strong names and, 446 implementation inheritance, 89, 90–98 IntelliSense, 44, 60, 115, 374, 375, 388, 709, 1128, interface inheritance, 89, 101 1155, 1157, 1189, 1234, 1239 multiple (C++), 90 Interface Defi nition Language. See IDL multiple interface inheritance, 90, 105 interface inheritance, 89, 101 private (C++), 90 interface references, 104 structs and, 82, 90 interfaces, 100–105. See also specifi c interfaces types, 89–90 code contracts for, 465–466 Init(), 965, 966 COM and, 697–698 initialization custom, 697 of arrays, 130, 132, 133, 228 defi ning/implementing, 101–104 of variables, 27 derived, 104–105 InitializeComponent(), 390, 391, 586, 675, 1122 dispatch, 697 InitializePerformanceCounts(), 486, 487 dual, 697–698 InitializeService(), 889, 890, 1108 generic, 118–123 InitializeViewModel(), 1334, 1335, 1336 Hungarian notation and, 102 Inline (base class), 1078 IL and, 7 inline comments, 53 .NET Framework and, 697–698 Inline elements, 1078–1080 object-oriented programming and, 100

1441

bbindex.inddindex.indd 14411441 11/28/10/28/10 1:28:011:28:01 PMPM InterfaceType attribute – Just-in-Time compilation

InterfaceType attribute, 717 IStructuralComparable, 147–149 Interlocked class, 520 IStructuralEquatable, 147–149 Interlocked.CompareExchange(), 520 ISupportErrorInfo, 700 Interlocked.Increment(), 520 It Just Works (IJW), 726 Intermediate Language. See IL item controls (WPF), 998 internal (modifi er), 66, 99 ItemsControl class, 986 internal comments, 53. See also comments ‹ItemSeparatorTemplate›, 1177 Internet (permission set), 564 ItemsPanelTemplate, 1012 Internet Assigned Numbers Authority. See IANA ItemTemplate, 1017–1018 ‹ItemTemplate›, 1177 add-ins and, 747 iterator blocks, 142, 145 instances (WebBrowser control), 645 ITransferBankAccount, 104 Internet Information Server. See IIS IUnknown, 7, 696, 697, 698, 705, 707, 713, 717, 722 Internet Protocol version 4. See IPv4 IValidationErrorService, 1337 Internet Security Zone, 421 IWelcome, 702, 705, 707, 711, 715, 722 interop. See COM interop interoperability. See language interoperability J Intersect(), 276, 283, 879 InvalidOperationException, 122, 123, 160, 237 jagged arrays, 133–134 invariant cultures, 571 Java invariants, 465 disadvantages of, 4 InvokeMember(), 440 exception handling, 13 InvokeMethod activity, 1313 garbage collection, 11 IOperation interface, 749, 750, 754, 762 import statement, 25 IP addresses (DNS names, host names), 654–656 interoperability and, 7 defi ned, 654 Java byte code, 4 .NET classes for, 654–655 syntax, 25, 42 IPAddress class, 654–655 types, 33 IPartImportsSatisfi edNotifi cation, 763 JavaScript IPerson interface, 465, 466 Ajax and, 1220 IPHostEntry class, 655, 656 browser integration. See browser integration IPrinciple interface, 546, 547, 568 debugging, AJAX and, 1239–1240 IProducerConsumerCollection‹T›, 226 dynamic programming and, 295 IPv4 (Internet Protocol version 4), 654 OOP extensions, 1235–1236 IPv6 (Internet Protocol version 6), 654 ScriptRuntime and, 300 IQueryable‹T›, 294, 883, 888, 889, 898 Web Forms and, 18 IRequestHandler, 886 Windows Forms and, 21 IResourceReader, 584 JavaScript Object Notation. See JSON IResourceWriter, 584 JavaScriptInterop, 1110 IronPython, 295, 300, 301, 302 JavaScriptInterop/MainPage.xaml, 1111, 1112 IronRuby, 295, 300 JIT (Just-in-Time) compilation, 4 is operator, 152, 155 Join(), 208 IsApplication, 419 Join (operator), 276, 282–283 IsBackground, 498 join operators (query operator category), 276, 282–283 IsDocumentAvailable, 238 journal queues, 1361–1362 ISet‹T›, 226, 255 JSON (JavaScript Object Notation), 1281, 1282 isolated storage, 806, 810–814 ASP.NET AJAX and, 1221, 1222 access types for, 810–811 SOAP v., 1282 IsolatedStoragePermission, 563 WCF and, 1282 IsolatedStorageFilePermission, 563 WCF Data Services and, 886, 891, 893, 894, 902 isolation (ACID), 607. See also ACID Jump Lists, 1411, 1414–1415 isolation level (transactions), 624–626, 824–825 jump statements, 43–44. See also break statements; IsolationLevel property, 611, 625, 626, 1294 continue statement; goto statements; return statement IsSubsetOf(), 255 anonymous methods and, 197 IsSupersetOf(), 255 Just-in-Time compilation. See JIT compilation

1442

bbindex.inddindex.indd 14421442 11/28/10/28/10 1:28:021:28:02 PMPM KeepAlive property – LINQ to SQL

K layout containers(WPF), 999–1002 LayoutDemo/CanvasWindow.xaml, 1000 KeepAlive property, 641 LayoutDemo/DockPanelWindow.xaml, 1001 key exchange, secure transfer and, 556–558 LayoutDemo/GridWindow.xaml, 1002 key generation, with SQL Server, 857–858 LayoutDemo/StackPanelWindow.xaml, 1000 key type, 248–250 LayoutDemo/WrapPanelWindow.xaml, 1000 keyframe animations, 1025–1026 LayoutEditorPart, 1212 KeyNotFoundException, 247, 253 ‹LayoutTemplate›, 1177 keys, registry, 807 lazy loading keywords. See also specifi c keywords of parts (add-ins), 764–765 generic classes and, 113, 114 of relationships, 876 as identifi ers, 58–59 Lazy‹T, TMetadata›, 761 list of, 58–59, 62–63 left-hand side (lhs), 167 modifi ers and, 99–100 Length property (FileInfo), 774 names and, 62–63 lhs (left-hand side), 167 Keywords (project property), 414 library assembly (WhatsNewAttributes), 338–339 license agreement (dialog box), 424 L LIFO (last in, fi rst out), 240, 266 lights (3-D with WPF), 1030, 1032 Label class, 995 #line, 57–58 Label control, 1136, 1160 Line class, 987 Lambda expressions, 126, 197–200. See also delegates; LinearGradientBrush, 731, 991–992, 1004 events LineGeometry, 988 delegates and, 183, 197 LineSegment, 989 dynamic type and, 297 link local clouds, 1344 Expression class and, 200, 292 LinkButton control, 1160 Expression‹T› and, 290, 291, 292, 293 linked lists, 241–246 multiple code lines and, 198–199 LinkedList, 110, 111, 112 parameters and, 198 LinkedListNode, 110, 111 variables outside of, 199 LinkedListNode‹T›, 112, 242 LambdaExpressions/Program.cs, 198 LinkedListObjects/LinkedListNode.cs, 110, 111 language extensions, dynamic, 295–305 LinkedListSample/Document.cs, 242 language independence LinkedListSample/LinkedList.cs, 113 .NET Framework, 7, 13 LinkedListSample/LinkedListNode.cs, 112 Visual Studio, 385 LinkedListSample/PriorityDocumentManager.cs, 244 Language Integrated Query. See LINQ LinkedListSample/Program.cs, 113, 246 language interoperability, 5–6. See also COM interop LinkedList‹T›, 110, 112, 113, 241, 242, 265 defi ned, 7 LinkLabel control, 645 IL and, 5–6, 7–8 LINQ (Language Integrated Query), 267–294. See also strong data typing and, 8–9, 157 Parallel LINQ; queries language specifi cations, 60. See also CLS; usage extension methods, 272–273 conventions overview, 267–268 Large Object Heap, 312 providers, 293–294 Last (element operator), 276 WCF Data Services and, 897–898, 902 last in, fi rst out (LIFO), 240, 266 LINQ to Amazon, 294 LastAccessTime, 774 LINQ to Entities, 883–884 LastIndexOf(), 208, 232 LINQ to Flickr, 294 LastIndexOfAny(), 208 LINQ to LDAP, 294 LastModifi edAttribute, 338, 347, 348 LINQ to MySQL, 294 LastOrDefault, 276 LINQ to Objects, 288, 291, 294 LastWriteTime, 774 LINQ to SharePoint, 294 late binding, 433, 698, 715 LINQ to SQL, 293, 294 Launch Conditions editor, 426–427 Chapter 56 (online), 904 layered/modular approach, to network Dynamic Data LINQ to SQL Web Application, communication, 657 380, 1251

1443

bbindex.inddindex.indd 14431443 11/28/10/28/10 1:28:031:28:03 PMPM LINQ to SQL – MagicShop.mdf database

LINQ to SQL (continued) satellite assemblies and, 434, 579, 581, 588, 590, 594, dynamic data sites and, 1251, 1252, 1256, 1260, 597, 598, 603 1261, 1262, 1274 System.Resources and, 569, 580, 584, 603 LINQ to XML and, 975 Uid attributes and, 594, 596–597 provider classes, 818 Visual Studio 2010 and, 584–591 System.Data.Linq.SqlClient, 818 Windows Forms application and, 584–591 LINQ to XML, 293, 954 WPF and, 593–598 CRUD operations and, 954 Localization (project property), 414 helper objects, 943–948, 954 Localize control, 1162 LINQ to SQL and, 975 LocalUserAppDataPath, 1118 .NET Framework and, 942–943 LocBaml tool, 597–598 querying dynamic XML documents, 949–951 lock statement, 238, 515–520 querying static XML documents, 948–949 Log property, 477 LinqDataSource, 1162 LogDisplayName property, 477 LINQIntro/Program.cs, 271 logical layer, 862, 863–864 , 17 logical operators, 151 ‹list›, 53 Login, 1203 list binding (WPF), 1045–1047 login web server controls, 1203–1204 List class, 1081 login.cs, 821 ListBox control, 638, 641, 998, 1127–1128, 1160 LoginName, 1204 ListBox elements LoginStatus, 1203 control templates for, 1018–1020 LoginView, 1203 styling of, 1016–1017 logos for applications (requirements), 1398 ListBoxChrome, 998 LogVisits, 419 ListBoxItem, 995 long, 33 lists, 226–236, 1081–1082 LongTask(), 539, 541 binding to, 1045–1047 lookup, dictionaries and, 253–254 creating, 228–236 LookupSample/Program.cs, 254 elements in Lookup‹TKey, TElement›, 246, 253, 287 accessing, 230–231 LookUpWhatsNew assembly, 34, 337, 345 adding, 229 LookUpWhatsNew.cs, 346 inserting, 230 loops, 40–43. See also do...while loops; for loops; removing, 231–232 foreach loops; while loops searching, 232–233 Parallel.For() and, 504–506 sorting, 234–235 Parallel.ForEach() and, 506–507 linked, 241–246 LostFocusEventManager, 204 sorted, 246–247 lower-level network protocols, 656–657 ListSamples/Program.cs, 229 ListSamples/RacerComparer.cs, 234–235 M ListSamples/Racer.cs, 227–228 List‹T› class, 108, 109, 225, 226 MachineName, 477, 685 ListView control, 1136, 1163, 1178–1179 MAF (Managed Add-in Framework), 747–748. See also Literal control, 1161 MEF Load(), 344 Chapter 50 (Managed Add-in Framework), 561, 748, 769 LoadFrom(), 344 MEF v., 747–748 loading assemblies, dynamically, 438–441 sandboxing and, 561 local variable scope, 29–31 mage.exe, 420 localhost, 664 mageUI.exe, 420 LocalIntranet (permission set), 563 MagicShop.mdf database, 1251–1255, 1261–1274 localization, 569–603 ASP.NET MVC application, 1261–1274 ASP.NET and, 591–593 Create() and, 1269–1273 BookOfTheDay and, 584–590 data access model for, 1251–1252 defi ned, 569 data source added to, 1252 resource dictionaries and, 594–598 Edit() and, 1273–1274 resource fi les and, 579–584 ID values in, 1255 scaffolding and, 1252–1253

1444

bbindex.inddindex.indd 14441444 11/28/10/28/10 1:28:031:28:03 PMPM MailMessage – Message property

MailMessage, 657, 658 MD5 algorithm, 554, 969 Main(), 24, 26, 48–50 MD5CryptoServiceProvider, 969 multiple, 48–49 MDAC versions, 409, 427 passing arguments to, 49–50 MDI (multiple document interface) applications, 78, threads and, 492 1141, 1142, 1146 main function (service program), 669 MediaElement, 993, 994 MainWindow, 1400 MeetingRoomBooker.mdf, 1169–1171 making, 394. See also building; compilation MEF (Managed Extensibility Framework), 747–769. Managed Add-in Framework. See MAF See also MAF managed C++, 6, 8 architecture, 747–754 managed code, 4, 6, 8, 10, 15, 16 catalogs and, 748, 749, 767–769 Managed Extensibility Framework. See MEF categories of, 748 managed heaps. See heaps containers and, 748, 749, 765–767 Managed Resources Editor, 582, 594 contracts and, 749, 754–755 managed types, 320 export providers and, 765–767 manifests exports and, 749, 755–762 assembly, 14, 433 extension methods and, 748, 751, 764, 765 ClickOnce applications, 419, 420 imports and, 749, 762–765 properties/settings, 420–421 MAF v., 747–748 ManufacturedDataSet.cs, 840, 842 member access operator, 152 ManufactureProductDataTable(), 840 member variables. See fi elds Manufacturer (project property), 414 members (of classes), 66 ManufacturerURL, 414 data members, 66–67 many-to-many relationship, 873 function members, 67 mapped-memory fi les, 799–800 MembershipProvider, 549 MappedMemoryFiles.sln, 800 MemberwiseClone(), 85 mapping layer, 862, 865–866 memory Mapping Schema Language. See MSL access, with pointers, 317–325. See also pointers maps. See dictionaries allocation. See also heaps; stacks markup extensions, 741–744 on heap, 309–311 curly braces and, 741, 742 on stack, 308–311 custom, 742–743 freeing. See garbage collection XAML-defi ned, 744 memory leaks, 10 MarkupExtension, 742 memory management, 307–332. See also garbage MarkupExtensionDemo/CalculatorExtension.cs, 743 collection MarkupExtensionDemo/MainWindow.xaml, garbage collection and, 307, 696 741, 743 under the hood, 307 MarshalByRefObject, 444, 566, 772, 788 memory type safety, 13, 22 marshaling, 7, 12, 696, 701, 772 MemoryStream, 787, 788 Marshal.ReleaseComObject(), 708, 709 Menu class, 886, 887, 894, 998 MaskedTextBox control, 1137–1138 Menu control (navigation web server control), 1199 MaskedTextProvider, 1138 menu planner application, 1086–1089 master details binding, 1048 MenuBase, 998 master pages, 1195–1198 MenuCard, 887, 888 accessing, from web pages, 1196 MenuCardDataModel, 888, 889 nested, 1197 MenuDataService, 889, 890 in PCSDemoSite, 1197–1198 MenuItem, 998 matches (regular expressions), 219, 223–224 MenuStrip control, 1141 MathClient.cs, 51 Merge(), 856, 965, 966 MathLibrary.cs, 50 Merge Module Projects, 412 MathLibrary.xml, 54–55 MergeOption enumeration, 876 MathOperations class, 188, 189, 190, 193, 194 meshes, 1342. See also clouds MathTest.cs, 68–69 Message class, 1372, 1376, 1377, 1385. See also Max(), 276, 286 messages MaxItemsInObjectGraph, 1295 message contracts, 1293–1294 mc.exe, 481 Message property (System.Exception), 359

1445

bbindex.inddindex.indd 14451445 11/28/10/28/10 1:28:041:28:04 PMPM message queues – Money class

message queues, 1361–1362 delegates with, 196–197 acknowledgment, 1376–1377 dynamic programming (C#) and, 295 creating, 1362 declaring, 67–68 fi nding, 1364–1365 exports (MEF) and, 759–760 installation, 1384 extension, 86–87 opening, 1365–1366 functions v., 67 poison, 1359 generic, 123–128 properties, 1363 hiding, 92–93 transactional, 1377–1378, 1382, 1385 invoking, 68–69 types of, 1361–1362 naming conventions, 60–63 Message Queuing, 1357–1385 for Object class, 84–86 administrative tools, 1362–1363 overriding, 91–92 architecture, 1361–1362 parameters passed into, 69–70 asynchronous programming v., 1357–1358 properties v., 64 Course Order (sample application), 1370–1384 sealed, 94 e-mail and, 1358 System.Type, 341–342 features of, 1359–1360 usage guidelines, 64 overview, 1357–1360 virtual, 91–92 products, 1360 MEX (Metadata Exchange) endpoints, 1281, 1288, programming, 1363–1370 1304, 1305 reasons for using, 1358–1359 MFC (Microsoft Foundation Classes), 379, 712, synchronous programming v., 1357–1358, 1362 1117, 1142 triggers and, 1360 Microsoft Foundation Classes (MFC), 379, 712, with WCF, 1378–1385 1117, 1142 message resource fi les, 479–483 Microsoft Intermediate Language. See IL message text fi les, 480 Microsoft Live ID Authentication, 1201 MessageLoop, 1119 Microsoft Management Console snap-in. See MMC MessageQueue, 1363, 1364, 1365, 1385. See also snap-in message queues Microsoft Message Queue (MSMQ) Server Core, 1360 MessageQueue.Create(), 1363, 1377, 1384 2010. See Visual Studio 2010 MessageQueueInstaller, 1364, 1384 Peer-to-Peer Networking platform, MessageQueuePermission, 563 1343–1346 MessageResourceFile, 479 PNRP, 1339, 1343–1346, 1355 messages (Message Queuing), 1361 Microsoft.CSharp, 438 delivery modes, 1361 Microsoft.SqlServer.Server, 957 priority, 1372–1373 Microsoft.Win32 namespace, 771, 806, 808 receiving, 1368–1370 Microsoft.Win32.SafeHandles, 726 recoverable, 1372–1373 Min(), 276, 286 sending, 1366–1368 MMC (Microsoft Management Console) snap-in types of, 1361 Certifi cates, 568 Messages Compiler, 481 Component Services, 616 meta-characters, 220, 221, 223 Computer Management, 1362 metadata Services, 616, 669, 683 assemblies and, 14, 15 model (MVC framework), 1260. See also MVC COM and, 696 models (3-D with WPF), 1030–1031 exports (MEF) and, 760–761 Models directory, 1261 .NET Framework and, 696 Model-View-Controller. See MVC Metadata Exchange (MEX) endpoints, 1281, 1288, modifi ers, 99–100. See also keywords 1304, 1305 list of, 99, 100 Metadata property, 761 visibility, 66, 99 MetadataWorkspace, 872 ModifyAccessControl(), 560 method binding, 698 modular/layered approach, to network method overloading, 65, 72, 98, 168, 181 communication, 657 methods, 67–72 modules, 435–436. See also assemblies anonymous, 196 Money class, 85, 86

1446

bbindex.inddindex.indd 14461446 11/28/10/28/10 1:28:051:28:05 PMPM Monitor class – NativeObjectSecurity

Monitor class, 521 multithreading, with ambient transactions, 621–624 project, 4 MultithreadingAmbientTx/Program.cs, 622 Moonlight, 1096 MultiTrigger, 1010 MortimerPhones.cs, 95 MultiView control, 1161 MouseMove, 736 MusicTitles, 144 “move” methods (XPathNavigator class), 918 mutex (mutual exclusion), 523–524, 559 MoveNext(), 141, 142, 143, 146 mutual exclusion. See mutex MoveTo(), 774, 780, 918 MVC (Model-View-Controller), 1260. See also ASP. MoveToAttribute(), 918 NET MVC MoveToFirst(), 918 myArray, 130, 131 MoveToFirstAttribute(), 909, 918 MyAttachedPropertyProvider, 739, 740 MoveToFirstChild(), 918 MyBase, 177, 178 MoveToId(), 918 MyDerived, 177 MoveToLast(), 918 MyForm/NotepadForms.cs, 1118 MoveToNext(), 918 MyGradientBrush, 1004, 1006 MoveToNextAttribute(), 909, 918 MyGroovyMethod(), 92, 93 MoveToParent(), 918 MyThread, 497 MoveToPrevious(), 918 MoveToRoot(), 918 N moving/copying/deleting fi les, 780–783 command, 596 N (number format), 52, 213 MSBuild tasks, 450, 728 Name property MSDeploy Publish option, 411 FileInfo or DirectoryInfo, 774 MSDN documentation RegistryKey, 810 Entity SQL and, 867 named arguments, 71 escape sequences in, 221 Named Pipes, 799 message text fi les, 480 namespace alias qualifi er (: :), 47, 152 Visual Studio 2010 and, 375 namespace aliases, using keyword and, 47–48 MSL (Mapping Schema Language), 861, 864, 865, 867, namespaces, 17, 25, 45–46. See also specifi c namespaces 884 ADO.NET, 818 MSMQ DCOM proxy, 1360 assemblies v., 46, 434 MSMQ HTTP Support, 1360 C++ header fi les and, 47 MSMQ (Microsoft Message Queue) Server Core, 1360 names for, 61 MsmqIntegrationBinding, 1301 using keyword and, 25, 46–47 MSXML, 906, 914 in WPF, 984–985 MTAs (multithreaded apartments), 501, 699–700, 710, naming conventions, 60–63 718 case sensitivity multibinding, 1048–1049 C#, 61, 73 multicast delegates, 193–196 format strings and, 52 Multicast Support, 1360. See also Message Queuing identifi ers and, 58 MulticastDelegates/MathOperations.cs, 194 IL, 9 MulticastDelegates/Program.cs, 193 casing schemes, 60 MulticastDelegateWithIteration/Program.cs, 195 constraints, 859 multidimensional arrays, 132–133 database columns, 859 Multiline, 220 database tables, 859 multiline comments, 25, 53 generic types, 110 multiple casting, 179–182 name styles, 61 multiple catch blocks, 355–359 namespace names, 61 multiple code lines, Lambda expressions and, 198–199 stored procedures, 859–860 multiple document interface (MDI) applications, 78, , 451–452, 459 1141, 1142, 1146 Native Runtime Optimization Service, 452 multiple inheritance (C++), 90 NativeActivity, 1311, 1312, 1324, 1325 multiple interface inheritance, 90, 105 NativeActivity‹TResult›, 1311, 1312 multiple Main() methods, 48–49 NativeMethods.RegisterServiceCtrlHandler[Ex](), 676 multiplication (*), 157, 167, 168, 319 NativeMethods.StartServiceCtrlDispatcher(), 676 multithreaded apartments. See MTAs NativeObjectSecurity, 559

1447

bbindex.inddindex.indd 14471447 11/28/10/28/10 1:28:061:28:06 PMPM Navigate() – new keyword

Navigate(), 644, 645 DynamicPartitionerForArray‹TSource› and, 290 navigation web server controls, 1198–1201 HashSet‹T› and, 255 NavigationWindow class, 996 IProducerConsumerCollection‹T› and, 226 Navigator.cs (code snippet), 919, 920, 921 ISet‹T› and, 226 nested for loops, 41–42 IStructuralComparable and, 147–149 nested master pages, 1197 IStructuralEquatable and, 147–149 nested namespaces, 46 LINQ providers and, 293–294 nested partial classes, 83 Managed Extensibility Framework. See MEF nested scopes, with ambient transactions, mapped-memory fi les and, 799–800 620–621 multi-targeting, Visual Studio 2010 and, 375, nested try blocks, 360–362 403–404 NestedFor.cs, 42 parallel programming and, 15 .NET applications ParallelEnumerable and, 289 confi guration, 452–454 SortedSet‹T› and, 255 System.Data.Service.Client and, 895–902 StaticPartitionerForArray‹TSource› and, 290 .NET base classes. See base classes System.Collections.Concurrent and, 225, 262, 290 .NET component (from COM client) tuples and, 129, 146 COM client application, 718–719 WebBrowser control and. See WebBrowser control connection points added to, 720 Zip() and, 276, 284–285 creating, 713–714 .NET Framework for Silverlight, 1095, 1096. See also type library for, 714–716 Silverlight .NET enterprise architecture, C# and, 20–21 .NET programming, with SQL Server, 955–980 .NET Framework. See also .NET Framework 4 .NET Refl ector, 435, 823, 1321 architecture, 3–22 .NET Remoting, 13, 20, 566, 1279, 1280, 1291, 1308 attributes and, 13 .NET resource fi les. See resource fi les C# v., 3–4 .NET runtime. See CLR code-based security and, 11 net.exe utility, 683, 684 COM+ and, 6 NetMsmqBinding, 1301 COM v., 6, 695–701 netMsmqBinding, 1301, 1382, 1383, 1384 compilation process and, 4, 21–22 NetNamedPipeBinding, 1301 DOM and, 913–917 NetPeerTcpBinding, 1300 errors and, 351. See also exceptions NetTcpBinding, 1300, 1301, 1350, 1351 events and, 701. See also events NetTcpContextBinding, 1300 exceptions and. See exceptions network communication, 637–665. See also peer-to- execution process and, 21–22 peer networking IL and, 6 client-server architecture, 1340 interfaces and, 697–698. See also interfaces modular/layered approach to, 657 language independence, 7, 13 .NET Framework and, 637 LINQ to XML and, 942–943 performance counters and, 484 metadata and, 696 network protocols. See also HTTP protocol; TCP method binding and, 698 lower-level, 656–657 Mono project and, 4 WCF and, 637 network communication and, 637–665 NetworkCredential, 642 P2P applications with, 1346–1355 networking (ASP.NET AJAX Library layer), 1223 platform independence, 4 networking example (Silverlight), 1102–1110 usage conventions and, 60 ADO.NET Entity Data Model, 1102 Visual Basic 2010 and, 5 calling WCF Services, 1104–1107 Visual C++ 2010 and, 5–6 System.Net and, 1109–1110 XML and, 903, 904, 942–943 using WCF Data Services, 1107–1109 .NET Framework 4. See also base classes; contra- WCF service for Silverlight clients, 1103–1104 variance; covariance; parallel programming; tuples NetworkStream class, 656, 787 base classes and, 16 neutral cultures, 571 cancellation framework, 290–291, 507–510 Nevermore60Customer, 95, 96, 97, 98 covariance/contra-variance and, 118 new keyword, 27, 32 DLR and, 295, 305 classes/structs and, 66

1448

bbindex.inddindex.indd 14481448 11/28/10/28/10 1:28:061:28:06 PMPM New Project dialog box – OLE DB provider

hiding methods and, 92, 105 methods, 84–86 as modifi er, 100, 105 object keyword and, 91 var keyword and, 79 object contexts, 871–873 New Project dialog box, 379, 381, 403, 405, object creation operator, 152 413, 1310 object keyword, 91 newline (escape sequence), 35 object model (ADO.NET), 817, 835–844 ngen.exe, 451–452, 459 object queries, 876–879 Nikhil’s Web Development Helper, 1239 object tracking, 880, 900 node insertion (XmlDocument class), 915–917 object type (reference type) NodeType property, 906 System.Object and, 35 nonblittable data types, 701 uses for, 36 non-CLS-compliant code, 10 ObjectContext class, 871–873 nondeterministic destruction, 823 CreateQuery‹T›() of, 294 non-generic collection classes, 108, 225, 732. See also methods, 872–873 generic collection classes properties, 872–873 non-linear animations, 1023 System.Data.Objects and, 862 nonrepeatable reads, 625, 626 ObjectDataSource, 1162 Norm(), 216, 217 object-oriented programming. See also classes; normal messages, 1361 CTS types; data types; inheritance; interfaces; Northwind database, 820 overriding; usage conventions Categories table, 843, 857, 858 C# and, 3 Customers table, 832–833, 874, 875 CTS and, 9 database connections and, 820–821 goto statement and, 43 Order Details table, 874, 875 IL and, 7 Orders table, 874, 875 interfaces and, 100 Products table, 839, 842, 843, 844 online information (Chapter 53) for, 7 Region table, 829–831 refactoring and, 401–403, 406, 695 stored procedures and, 829–832 usage conventions and, 60, 64 NorthwindDemo/NorthwindModel.Designer.cs, 876 ObjectQuery‹T›, 294, 877, 878, 883 NorthwindDemo/Program.cs, 875 Query Builder methods, 876, 878–879 Not(), 258, 259 object-relational mapping, 861, 862. See also ADO.NET Nothing (permission set), 563 Entity Framework NoTracking, 876 objects (as instances of classes), 185 NotSupportedException, 141, 143, 236 ObjectSecurity, 559 NT Services. See Windows Services ObjectSet‹T›, 871, 876, 877, 881 null ObjectStateManager, 872, 876, 880, 881, 882 escape sequence for, 35 observable collections, 256–258, 898–899 generic types and, 113, 114 ObservableCollectionSample/Program.cs, 257 null coalescing operator (??), 123, 152, 156–157 ObservableCollection‹T›, 256–258, 266, 728, 732, 737, nullable types, 123 898, 899, 1053, 1106, 1109, 1381 casting, 159, 160–161 ODBC provider classes, 818 operators and, 156 ODBCCommand, 819 Nullable‹T›, 121, 122, 123 ODBCCommandBuilder, 819 NullExtension (x:Null), 744 ODBCConnection, 819 NullReferenceException, 132 ODBCDataAdapter, 819 number format (N), 52, 213 ODBCDataReader, 819 number formatting, cultures and, 572–573 ODBCParameter, 819 NumberAndDateFormatting/Program.cs, 573 ODBCTransaction, 819 numeric indexers, 834 ODP.NET, 818 Offering Syndication Feeds (sample), 1390–1394 O Offi ce (project type), 381 Offi ce Open XML (OOXML), 1089 object binding (WPF), 1040–1045 OfType(), 278, 879 Object Browser window, 393 OfType‹TResult›, 275 Object class (System.Object), 84 OLE DB provider, 832, 834, 850

1449

bbindex.inddindex.indd 14491449 11/28/10/28/10 1:28:071:28:07 PMPM OLE DB provider classes – OverwriteChanges

OLE DB provider classes, 818 delegate concatenation/removal, 152 OLE/COM Object Viewer, 714 increment, 151, 153, 154 OleDbCommand, 819, 826, 832, 833, 852 indexing, 152 OleDbCommandBuilder, 819 is, 152, 155 OleDbConnection, 819 list of, 151–152 OleDbDataAdapter, 819 logical, 151 OleDbDataReader, 819, 832, 833, 834 member access, 152 OleDbParameter, 819 namespace alias qualifi er, 152 OleDbTransaction, 819 null coalescing, 123, 152, 156–157 oleview32.exe, 714 nullable types and, 156 OnCustomCommand(), 676, 678 object creation, 152 One(), 195 overfl ow exception control, 152 one-dimensional arrays, 132 parentheses and, 157 one-to-many relationship, 873, 874, 875 primary, 154, 157 OnOuterButtonClick(), 736, 737 relational, 157 OnPause(), 676, 678, 690 shortcuts, 153–154 OnPowerEvent(), 676, 678 sizeof, 152, 155–156, 323 OnShutdown(), 678 string concatenation, 151 OnStart(), 676, 677, 678, 679, 690 type information, 152 OnStartUp(), 1399 typeof, 45, 152, 156, 340 OnStop(), 676, 678, 690 unary, 156, 157, 172, 319 OOP extensions, JavaScript, 1235–1236 unchecked, 152, 154–155 OOXML (Offi ce Open XML), 1089 workings of, 164–165 OPC (Open Packaging Convention), 1089 optional arguments, 71 Open(), 364, 365, 773, 774 optional attribute parameters, 337 Open Packaging Convention (OPC), 1089 Or(), 258, 259 OpenRead(), 638, 774 Oracle .NET Developer site, 818 open-source DLR, 295 Order Details table, 874, 875 OpenSubKey(), 810 OrderBy(), 275, 279, 280, 291, 879 OpenText(), 774 OrderByDescending(), 273, 275, 279 OpenWrite(), 639, 774 Orders table, 874, 875 Operate(), 749, 751, 760 orphaned objects, 32 operation batching (data service context), /out, 50 901–902 out keyword, 71, 119 OperationBehavior property, 1298 out parameters, 71 OperationContract, 882, 1292–1293 Out/In (attributes), 717 Operations/Operations2.cs, 761 out-of-browser Silverlight applications, Operations/Operations.cs, 759, 760, 762 1113–1115 operator overloading, 37, 67, 163–172 OutOfBrowserDemo/MainPage.xaml, 1114 classes and, 166 OutOfBrowserDemo/MainPage.xaml.cs, 1114 operators (list) for, 171–172 output fi lename, 416 string concatenation and, 208 outsourcing translations, 591 Vector Struct example, 165–171 overfl ow checking, 154, 155, 176 operator precedence, 157 overfl ow exception control, checked/unchecked operators, 67, 151–157. See also query operators; operators, 152, 154–155 specifi c operators Overfl owException, 154, 353, 354, 362 as, 152, 155 overloading. See method overloading; operator arithmetic, 151 overloading assignment, 152 override (keyword/modifi er), 91, 100, 105 binary, 156, 167, 172, 319 overriding cast, 152 comparison operator, 163 checked, 152, 154–155 Equals(), 162 comparison, 151, 152, 163, 164 methods, 91–92 conditional (ternary), 152, 154, 157, 223, 224 ToString(), 36, 82, 85 decrement, 151, 153, 154 OverwriteChanges, 876

1450

bbindex.inddindex.indd 14501450 11/28/10/28/10 1:28:081:28:08 PMPM P (percentage format) – PCSWebSite3

P partitioning operators (query operator category), 276, 285–286 P (percentage format), 52, 213 parts (add-ins), 748, 749 P2P. See peer-to-peer networking lazy loading of, 764–765 package fi les (project property), 416 loading of, 748 PadLeft(), 208, 292 Pascal casing, 60–61 PadRight(), 208 passing arguments to Main(), 49–50 PageCatalogPart, 1211 passing data to threads, 496–497 PageRequestManager, 1229, 1237–1238 PasswordBox, 995 PageRequestManager.beginRequest, 1237 PasswordRecovery, 1203 PageRequestManager.endRequest, 1238 Path class, 772, 775, 987 PageRequestManager.initializeRequest, 1237 PATH index, 978 PageRequestManager.pageLoaded, 1238 PathGeometry, 988 PageRequestManager.pageLoading, 1237 PathSeparator, 775 ‹PagerTemplate›, 1178 pattern, 219 paging, 285–286 Payments table, 873, 874 Panel class, 986, 999 PaymentsDemo/Program.cs, 874 Panel control, 1138, 1161 PCSAjaxWebSite, 1224–1226 Parallel activity, 1313–1314 PCSAuthenticationDemo, 1201–1205 Parallel class, 504–507 Forms Authentication and, 1201–1202 Parallel LINQ, 289–291 login system and, 1202–1203 cancellation framework and, 507 PCSWebParts and, 1212 threading issues and, 510 securing directories, 1204 parallel programming, 15 PCSCustomCWebSite1 (custom control), ParallelEnumerable, 289 1193–1195 ParallelEnumerable class, 289, 290 PCSDemoSite Parallel.For(), 504–506 master pages in, 1197–1198 cancellation of, 507–509 navigating in, 1200–1201 for loop v., 504 security in, 1204–1206 Parallel.ForEach(), 506–507 site map fi le added to, 1199–1200 Parallel.Invoke(), 507 themes in, 1208–1210 ParallelLinqSample/Program.cs, 289 user controls in, 1190–1191 ParallelQuery‹TSource›, 289, 290 PCSDynamicDataDemoEntities, 1252–1258 ParallelSamples/Program.cs, 504, 506, 507 PCSDynamicDataDemoLinq web site, 1252–1258 ‹param›, 53 PCSLibraryDemo project, 1234–1241 ParameterizedThreadStart, 495, 496, 497 PCSRoutingDemo, 1245–1250 ParameterResourceFile, 479 PCSUserCWebApp1 (user control), 1187–1190 parameters PCSWebParts, 1212–1218 arrays as, 139–140 in action, 1213–1215 and constructors, in hierarchy, 97–98 controls for, 1213 for custom attributes, 336–337 Date/Events controls, 1218 Lambda expressions and, 198 host page code, 1216–1217 out, 71 PCSAuthenticationDemo and, 1212 passed to methods, 69–70 Web Part code, 1217 ref, 70 PCSWebSite1 (ASP.NET), 1152–1158 zero-parameter constructor, 76, 82 creating, 1152–1153 ParameterTest.cs, 69–70 running, 1157–1158 ‹paramref›, 53 web page added to, 1153 Parent (DirectoryInfo), 773 web server controls added to, 1156–1157 parentheses, operator precedence and, 157 PCSWebsite2 (event-booking example), Parse(), 744 1164–1169 ParseCombiningCharacters(), 570 PCSWebSite3, 1169–1175 partial classes, 82–83 Calendar control and, 1172–1174 partial keyword, 82, 83 FormView control and, 1178–1179 Partitioner class, 290 ListView control and, 1178–1179

1451

bbindex.inddindex.indd 14511451 11/28/10/28/10 1:28:091:28:09 PMPM PCSWebSite3 – pointers

PCSWebSite3 (continued) pointers and, 317, 329–332 MeetingRoomBooker.mdf, 1169–1171 processes and, 12 binding to, 1171 performance counter builder, 484–486 events added to, 1174–1175 performance counts, 461, 484, 485, 486, 487, 488 tables, 1170 Performance Monitor (perfmon.exe), 375, 461, 478, templates and, 1178–1180 488–489, 692 Peek(), 237, 240 performance monitoring, 483–489 Peer Name Resolution Protocol (PNRP), 1339, PerformanceCounter, 483 1343–1346, 1355 PerformanceCounter components, 486–489 clouds, 1344–1345 PerformanceCounterCategory, 483, 484, 485, IDs, 1344 486, 487 in Windows 7, 1345–1346 PerformanceCounterDemo/MainWindow.xaml.cs, 485, peer names 486, 487 defi ned, 1343 PerformanceCounterInstaller, 483 registering, 1347–1348 Perl, 217, 218. See also regular expressions resolving, 1348–1349 ‹permission›, 53 peer presence, 1352, 1353 permission sets, 563–564 PeerCollaboration class, 1352 permissions, 562–567 PeerPresenceStatus enumeration, 1352–1353 code access, CLR and, 562–563 peers, 1342 demanding permissions programmatically, 564–565 contacts and, 1353 implicit, 566–567 defi ned, 1341, 1342 Sandbox API and, 562, 565–566 discovering, 1353 PersonComparer, 138 groups of, 1342. See also clouds phantom reads, 625, 626 signing in/signing out, 1352 PhoneCustomer class, 66 PeerScope, 1352 Pick activity, 1314–1316, 1321, 1328, 1330, 1331 peer-to-peer networking (P2P), 1339–1355 PictureBox control, 1136–1137 architecture, 1340–1342 pin buttons, 394 challenges, 1341–1342 pinning/unpinning windows, 394 client-server architecture v., 1340–1341 p/invoke. See platform invoke communication and, 1341, 1342 P/Invoke Interop Assistant, 723 connection and, 1341, 1342 pinvoke.net, 723 discovery and, 1341–1342 PInvokeSample/NativeMethods.cs, 725 Microsoft Windows Peer-to-Peer Networking PlaceHolder, 1161 platform, 1343–1346 platform independence (.NET), 4 overview, 1339–1343 platform invoke (p/invoke), 16, 632, 722–726, 799, PNM. See People Near Me 1398, 1402, 1408 PNRP and, 1339, 1343–1346, 1355 PLINQ Execution Engine, 15 sample applications, 1346–1355 pluggable controls, 652 solutions, 1342–1343 PNM. See People Near Me System.Net.PeertoPeer, 1347–1352 PNRP. See Peer Name Resolution Protocol System.Net.PeertoPeer.Collaboration, 1352–1355 PnrpPermission, 1349 terminology, 1342 PnrpPermissionAttribute, 1349 Peer-to-Peer Networking platform (Microsoft pointer member access operator (-›), 323–324 Windows), 1343–1346 PointerPlayground, 325–329 People Near Me (PNM), 1339, 1346 PointerPlayground/Program.cs, 326 signing in/signing out, 1352–1353 PointerPlayground.sln, 327 percentage format (P), 52, 213 pointers, 8, 11, 12, 32 perfmon.exe. See Performance Monitor adding, 322 performance arithmetic operations on, 322–323 collection classes and, 264–266 array syntax and, 331 exceptions and, 351 backward compatibility and, 317 garbage collection and, 311–312 casting generics and, 108 between pointer types, 321 IL and, 4–5 pointers to integer types, 320–321

1452

bbindex.inddindex.indd 14521452 11/28/10/28/10 1:28:101:28:10 PMPM poison messages – properties

to class members, 324–325 priority binding, 1049–1051 to classes, 324 priority messages, 1372–1373 code access security and, 318 priority node, 242, 244, 245 example (PointerPlayground), 325–329 PriorityDocumentManager, 243, 244, 246 memory access with, 317–325 private (modifi er), 66, 99 performance and, 317, 329–332 private assemblies, 14–15, 434, 447, 448, 452, 453, 454, QuickArray example, 331–332 459. See also shared assemblies reasons for, 317 private inheritance (C++), 90 reference types and, 317 private queues, 1361 to structs, 323–324 private/public keys, 552–554 subtracting, 323 ‹probing›, 454 syntax, 319–320 Process class, 643 type safety and, 8, 318 ProcessAndDisplayNumber(), 189, 190, 194, 195 unsafe code and, 317–319 ProcessDocuments, 238, 239 void, 321 processes. See also application domains poison messages, 1359 code isolation and, 11–12 poison queue, 1359 performance and, 12 polling, 493 security and, 12 PolyBezierSegment, 989 ProcessRequestForMessage(), 886 Polygon class, 987 ProductCode, 414 Polyline class, 987 product.cs, 846, 847, 848, 849 PolyLineSegment, 989 ProductDataTable, 846–847 PolyQuadraticBezierSegment, 989 ProductName (project property), 414 Pop(), 240, 241, 263, 265 ProductRow class, 848–849 POP protocol, 656 Products table, 839, 842, 843, 844 POST, 639, 656 Products.xsd, 844 PostBuildEvent, 414 Professional ASP.NET4: in C# and VB (Wiley postconditions, 464 Publishing), 247, 1156, 1181 postfi x/prefi x, 153 Professional Microsoft SQL Server 2008 Programming #pragma, 58 (Wiley Publishing), 955 PreBuildEvent, 414 Professional XML (Wiley Publishing), 904 precedence, operator, 157 ProgId attribute, 716 preconditions, 463–464 progress (dialog box), 424 preconfi gured host classes, 1303–1304 ProgressBar, 995 predefi ned integer types, 33 ProgressBar control, 1137 predefi ned reference types, 35–37 ProgressChangedEventArgs, 538, 1349 predefi ned value types, 33–35 projection operators (query operator category), 275 prefi x/postfi x, 153 projects (Visual Studio 2010). See Visual Prepare(), 627 Studio 2010 preparing phase (transactions), 606 promotable transactions, 614–616 preprocessor directives, 55–58, 387. See also custom properties, 67, 72–74. See also specifi c properties attributes access modifi ers for, 73 prerequisites URL, 416 attached, 739–741 PreserveChanges, 876 as attributes (XAML), 730–731 PreviewMouseMove, 736 auto-implemented, 74 primary key constraints (DataTable), 842 dependency, 732–736, 739 primary operators, 154, 157 as elements (XAML), 731 principal, identity and, 545–547 exports (MEF) and, 759–760 PrintDialog, 1091 methods v., 64 printing, 1091–1093 project, 414–415 with PrintDialog, 1091 read-only, 73 visuals, 1092–1093 System.Exception, 359–360 with WebBrowser control, 651 System.Type, 340–341 PrintingDemo/MainWindow.xaml.cs, 1093 usage guidelines, 64 PrintingPermission, 563 virtual, 91–92 priority, thread, 498–499 write-only, 73

1453

bbindex.inddindex.indd 14531453 11/28/10/28/10 1:28:111:28:11 PMPM Properties editor – Range()

Properties editor, 675 Queryable class, 294 Properties window, 391–392 Queryable‹T›, 291 Property (project property), 419 querying objects, 876–879 PROPERTY index, 978 QueryInterface(), 698, 702, 705, 708, 713, 719 property triggers, 1008–1009, 1014 QueryTimeout, 872 PropertyChangedEventManager, 204 queues. See also message queues PropertyGridEditorPart, 1212 collections and, 236–240 protected (modifi er), 66, 99 poison, 1359 protected internal (modifi er), 66, 99 QueueSample/Document.cs, 237 protocol stack, 657 QueueSample/DocumentManager.cs, 238 providers. See data providers QueueSample/ProcessDocuments.cs, 239 proxy servers, WebRequest and, 642 QueueSample/Program.cs, 239 ProxyWebPartManager, 1211 Queue‹T› class, 28, 237, 240, 262, 265 public (modifi er), 66, 99 QuickArray, 331–332 public keys QuickSort algorithm, 136 assembly manifests and, 433, 446, 448 Quote service (application example), 670–692 public/private key pairs, 552–554 client, 670, 673–675 strong names and, 445 QuoteClient, 670, 673–675 Trusted Application Deployment and, 421 completed application, 692 public queues, 1361 creating functionality for, 671–673 publisher policy fi les, 453, 457–458 event logging, 692, 693 publishing ClickOnce applications, 420 overview, 670 publishing web sites, 408, 411 QuoteService (Windows Service program), 670, pure virtual function, 93. See also abstract functions 675–683 Push(), 240, 263, 265 confi guration in registry, 679 Python, 295, 300, 302, 305 creating, 675–676 handler methods, 678 Q installation program, 679–683 main function, 676–677 QuadraticBezierSegment, 989 monitoring/controlling, 683–691 quantifi er operators (query operator category), 276 service start, 677–678 queries ServiceBase class, 676 to dynamic XML documents, 949–951 server, 670 LINQ queries QuoteServer, 670 deferred query execution, 272, 273–275 socket server, 670, 671, 677 Formula-1 champions and, 267–286 TestQuoteServer, 673 to static XML documents, 948–949 troubleshooting, 692 URL queries to WCF Data Services, 893–894 QuoteClient/MainWindow.xaml.cs, 674 to XML data types, 976–977 QuoteServer/QuoteServer.cs, 671 Query Analyzer, 851, 857 QuoteService/Program.cs, 677 Query Builder methods, 876, 878–879 QuoteService/ProjectInstaller.cs, 680 query operators QuoteService/ProjectInstaller.Designer.cs, 681 aggregate operators, 276, 286–287 QuoteService/QuoteService.cs, 677 conversion operators, 276, 287–288 element operators, 276 R fi ltering operators, 275, 277–278 generation operators, 276, 288–289 /r switch, 50, 51 grouping operators, 276, 280–281 race conditions, 15, 510–513 join operators, 276, 282–283 Racer class, 227, 267–269 list of, 275–276 RacerComparer, 234, 235 partitioning operators, 276, 285–286 RAD (Rapid Application Development), 406 projection operators, 275 RadialGradientBrush, 992 quantifi er operators, 276 radio buttons (dialog box), 424 set operators, 276, 283–284 RadioButton controls, 1126–1127, 1160 sorting operators, 275, 279–280 RadioButtonList, 1160 query string parameters, 1245–1246 Range(), 276, 288, 289

1454

bbindex.inddindex.indd 14541454 11/28/10/28/10 1:28:111:28:11 PMPM ranges – RegistryKey

ranges RedirectToAction(), 1269 bool type, 35 ref keyword, 70 decimal type, 34 ref parameters, 70 fl oating-point types, 34 refactoring, 401–403, 406, 695 integer types, 33 /reference, 50 RangeValidator, 1164 reference counts, 10, 696 rank (dimension), 132, 134, 136 reference types, 309–311 Rapid Application Development (RAD), 406 arrays and, 131–132 rc.exe, 482 defi ned, 8 RCW (runtime callable wrapper), 702, 707–709, 710, memory management and, 309–311 712, 726 object type. See object type RDF (Resource Description Framework), 1387. See also pointers and, 317 RSS predefi ned, 35–37 read me (dialog box), 424 string type. See string type read methods (XmlReader), 907–909 value types v., 8, 32–33 ReadAllByes(), 785, 786 ReferenceEquals(), 84, 162, 163 ReadAllLines(), 785, 786 references (to assemblies), 450–451 ReadAllText(), 785, 786 referent, 317 ReadCommitted (isolation level), 625, 825 refl ection, 15, 333–349 ReadElementString(), 907, 908 capabilities of, 333 ReaderWriterLockSlim, 530–533 defi ned, 333 ReaderWriterSample/Program.cs, 532 dynamic keyword and, 754 ReadFileIntoStringCollection(), 798 InvokeMember() and, 440 reading ACLs System.Type and, 85, 156, 340–342 from directory, 803–804 TypeView example, 342–344 from fi le, 802–803 Refl ectionModelServices, 748 reading drive information, 800–802 Refl ectionPermission, 563 reading from streams, 787 Refl ector (.NET Refl ector), 435, 823, 1321 reading from XML documents, 951–952 Refresh(), 649, 767, 873, 883 reading XAML, 744–745 RefreshButton_Click(), 1351, 1354 ReadingACLsFromDirector.cs, 804 REG_BINARY, 808 ReadingACLs.sln, 803 REG_DWORD, 808 ReadingFiles.sln, 785 regedit, 679, 806–808 reading/writing regedt32, 806 to fi les, 784–787 RegexOptions enumeration, 220 binary fi les, 789–793 #region, 57, 387, 1120 text fi les, 793–799 Region table (Northwind database), 829–831 to isolated storage, 810–814 RegionInfo, 571 to registry, 806–810 RegionInsert stored procedure, 853, 857 read-only collections, 236 regions, 570–574. See also cultures readonly fi elds, 77, 78–79 register user (dialog box), 424 read-only properties, 73 RegisterAttached(), 739 ReadSettings(), 811, 813 registering peer names, 1347–1348 ReadUncommitted (isolation level), 625, 825 registration, COM, 698–699, 718 ReadWriteText (sample application), 797–799 RegistrationService, 1103, 1106 ReadWriteText.sln, 797, 798 registry, 806–810 ReadXML(), 851, 932, 933 classes, 808–810 ReadXMLSchema(), 933 fi le system v., 806, 807 Really Simple Syndication. See RSS reading/writing to, 806–810 Receive activity, 1327, 1328, 1329 Registry class, 806, 808 receiving messages, 1368–1370 Registry editor, 422 recoverable delivery mode (messages), 1361 registry hives, 807 recoverable messages, 1372–1373 registry keys, 807 Rectangle class, 987 RegistryKey, 806 RectangleCollection class, 120 methods, 810 RectangleGeometry, 988 properties, 810

1455

bbindex.inddindex.indd 14551455 11/28/10/28/10 1:28:121:28:12 PMPM RegistryPermission – right-hand side (rhs)

RegistryPermission, 563 automatic fallback for, 590 REG_SZ, 808 creating, 579 regular expressions, 217–224 custom, 590 Beginning Regular Expressions and, 218 localization and, 579–584 captures and, 223–224 outsourcing translations with, 591 escape sequences, 218, 221 System.Resources and, 569, 580, 584, 603 groups and, 223–224 using, 581–584 matches and, 219, 223–224 WPF and, 594 strings and, 218 Resource Localization Editor, Windows, 591 RegularExpressionsPlayaround, 219–223 resource managers, 606 RegularExpressionsPlayaround.cs, 219 custom, 626–632 RegularExpressionValidator, 1164 IEnlistmentNotifi cation methods and, rehosting Designer. See Designer rehosting 626–627 relational operators, 157 transaction classes and, 626 relationships (ADO.NET Entity Framework), resource readers, 598–600, 603 873–876 ResourceDemo/Demo.Designer.cs, 584 Release(), 525, 696, 705, 708, 709, 713 ResourceDemo/Program.cs, 582 release builds, debugging and, 395–396 ResourceDictionary, 1005, 1007, 1008 ReleaseInstanceMode, 1298 ResourceHolder.cs, 316 ReleaseServiceInstanceOnTransactionComplete, ResourceManager, 584 1294 resources, transactional, 627–632 releasing COM objects, 708–709 resources (WPF), 1004–1008 reloading workfl ows, 1326 accessing, from code, 1006 ‹remarks›, 54 dynamic, 1006–1007 remoting services. See .NET Remoting hierarchies and, 1005 RemoveHandler(), 738 styles and, 1004 RemovePreviousVersions, 414 system-wide, 1005 RemoveRange(), 232 ResourceSet, 584 Repeat(), 276, 288, 289 ResourcesLib/Dictionary1.xaml, 1007 RepeatableRead (isolation level), 625, 825 Resources/Wrox.ProCSharp.Localization. RepeatBehavior, 1022 MyResources.txt, 579 RepeatButton, 995 ResourceWriter, 580, 584 Repeater, 1163, 1175 response messages, 1361 Replace(), 208, 209, 210, 211, 212 response queues, 1363, 1377 report messages, 1361 REST (Representational State Transfer), report queues, 1363 1281, 1282 Reports Application, 381 Restart Manager, 1398–1403 Representational State Transfer (REST), 1281, 1282 RestaurantDataServiceWeb/RestaurantDataService. request, 1181 svc.cs, 895 RequiredFieldValidator, 1164, 1257 RestaurantEntities, 896, 897, 898 RequireFileIOPermissionsDemo/ results, from tasks, 503–504 RequirePermissionsDemo.cs, 565 ResXFileRef, 584 Requires(), 463 ResXGen, 580 Reset(), 141 ResXResourceReader, 584 Resolve(), 655 ResXResourceSet, 584 resolving peer names, 1348–1349 ResXResourceWriter, 584 Resource Compiler, 482 Retry activity, 1319, 1320, 1321, 1322 Resource Description Framework (RDF), 1387. return statement, 44 See also RSS ‹returns›, 54 resource dictionaries Reverse(), 144, 145, 235, 275 localization and, 594–598 rhs (right-hand side), 167 XAML, 594–598 RichTextBox control, 793, 995, 1137–1138 Resource File Generator, 579–580 RichTextBox viewer, 1085 resource fi les (.NET resource fi les). See also message RichTextBoxStreamType, 1137, 1138 resource fi les right-hand side (rhs), 167

1456

bbindex.inddindex.indd 14561456 11/28/10/28/10 1:28:131:28:13 PMPM RightToLeft – SecureTransfer/Program.cs

RightToLeft, 220 S Rijandel, 554 role-based security, 547–548, 568 SACL (system access control list), 559 ASP.NET and, 547 safe (safety level), 956 code access security v., 11 SAFEARRAY, 701 declarative, 547–548 safe-critical code, 561 RoleBasedSecurity/Program.cs, 548 SafeHandle class, 632, 726 Rollback(), 611, 627, 679, 680 SalesSpyFoundException, 363, 366, 367, 368 Room table, 841 Sample1/Person.cs, 131 RoomReservation service (WCF), 1282–1290 Sample1/Program.cs (arrays), 132, 133, 134, 135, 136 custom service host, 1287 SampleRoleProvider, 550 diagnostics, 1289–1290 Sandbox API, 561, 562, 565–566 implementation, 1284, 1294 satellite assemblies, 434, 579, 581, 588, 590, 594, 597, service contract, 1283–1284 598, 603 WCF client, 1288–1289 SaveChanges(), 873, 882, 900, 901, 1103 WCF Service Host, 1284–1286 SaveFile(), 797 WCF Test Client, 1284–1286 SaverAccount, 103, 104 Root property (DirectoryInfo), 774 SaveSettings(), 811 RotateTransform, 990 SAX, 903, 904, 906. See also XmlReader; XmlWriter rotating, 990 sbyte, 33 rotation (3-D with WPF), 1032 scaffolding, 1251, 1252–1253 round-robin scheduling principle, 498, 499 controlling, 1255–1257 route authorization, 1247 defi ned, 1251 route order, 1248–1249 scalar, 165, 167, 168, 170 route parameters, 1249–1250 ScaleTransform, 990 RouteData values, 1249 scaling, 990 routing (ASP.NET), 1244–1251 sc.exe utility, 683, 684 confi guring, 1258–1259 schemas (data tables), 835 default parameter values, 1247–1248 generation, 839–840 defi ning routes, 1246–1249 hand-coded, 839–840 parameter constraints, 1248 XML, 844–850 PCSRoutingDemo, 1245–1250 scientifi c format (E/e), 52, 213 query string parameters, 1245–1246 SCM. See Service Control Manager URL operation, 1266–1267 scope RowDefi nition, 1001 local variable, 29–31 RSA algorithm, 554 transaction scope, 824–825 RSACryptoServiceProvider, 554 ScopeBad.cs, 30 RSS (Really Simple Syndication), 1387, scope.Complete(), 824 1389, 1390, 1393, 1394. See also Scope.cs, 29 Atom format ScopeTest2.cs, 30 Atom and, 1387, 1388 ScriptEngine, 300, 301, 302 dynamic XML documents and, 949–950 ScriptManager, 1222, 1228–1229 logo, 1388 ScriptRuntime (DLR), 300–302 Rss20FeedFormatter, 1388 Scripts directory, 1261 Rss20ItemFormatter, 1388 ScriptScope, 301, 302 Ruby, 295 ScriptSource, 301, 302 Rule enumeration, 843–844 ScrollBar control, 995 Run(), 238 ScrollViewer, 995 RunPostBuildEvent, 414 sealed (keyword/modifi er), 94, 100 runtime callable wrapper. See RCW sealed classes, 94 runtime schema generation, 839 sealed methods, 94 runtime serialization, 1291, 1368 SearchPath, 415 secure transfer, key exchange and, 556–558 SecureTransfer/Program.cs, 556

1457

bbindex.inddindex.indd 14571457 11/28/10/28/10 1:28:141:28:14 PMPM security – shapes (WPF)

security, 545–568. See also ACLs; authentication/ ServiceBase class and, 676 authorization; code access security service control programs, 668, 670 ASP.NET and, 1201–1206 service implementation (WCF), 1294–1299 ClickOnce applications and, 421–422 service programs, 668–669 encryption and, 552–558, 568 Service Trace Viewer tool, 474, 1290 fi les and, 771, 802, 814 ServiceBase class, 670, 676 in PCSDemoSite, 1204–1206 ServiceBehavior properties, 1294–1295 processes and, 12 ServiceCommandCallback(), 676 SQL programming and, 956 ServiceContract attribute, 886, 1292–1293 Security Setup Wizard, 1201–1203 ServiceControl/app.manifest, 691 security transparency level 2, 561, 562 ServiceController class, 670, 693 security-critical code, 561 custom service controller and, 684–692 SecurityException, 548, 564, 565 methods, 690 SecurityPermission, 563 properties, 685 ‹see›, 54 ServiceControllerInfo, 685, 686, 687, 688, 689, 690 ‹seealso›, 54 ServiceControllerPermission, 563 seed server, 1344 ServiceControl/ServiceControllerInfo.cs, 686 SELECT, 819, 828, 833, 850, 860 ServiceControl/ServiceControlWindow.xaml, 689 Select(), 273, 275, 277, 279, 281, 289, 290, 291, 879, ServiceControl/ServiceControlWindow.xaml.cs, 918, 920, 1172, 1391 688, 691 SelectAncestors(), 918 ServiceHost, 889, 895, 1287, 1301, 1303, 1328, 1381 SelectChildren(), 918 ServiceInstaller class, 670, 679, 680, 682, 693 SelectDescendants(), 918, 920 properties, 682 ‹SelectedItemTemplate›, 1177 ServiceInstallerDialog, 682 SelectMany(), 275, 278, 279 service-main function, 669 SelectSingleNode(), 915, 918, 974 ServiceMainCallback(), 676, 677 SelectValue(), 879 ServiceModel Metadata Utility tool, 1304, 1305, SelfPlacingWindow sample, 811, 812, 813, 814 1329 Semaphore, 524–525 ServiceName, 675, 682, 685 Semaphore/Program.cs, 524 ServiceProcessInstaller class, 670, 679, 680, 681, SemaphoreSlim, 524–525 682, 693 semicolons (;) services. See Windows Services C# and, 25 Services MMC snap-in, 616, 669, 683 Lambda expressions and, 198 ServicesDependentOn, 682, 685 preprocessor directives and, 56 Services.exe, 677 Send activity, 1327 ServicesToRun, 676, 677 sending messages, 1366–1368 ServiceType, 685 ‹SeparatorTemplate›, 1177 session, 1181 Serial.cs (code snippet), 935, 937, 938, 939, 940, 941 Set(), 258, 259 Serializable (isolation level), 625, 825 set accessor, 732, 733 serialization set operators (query operator category), 276, 283–284 defi ned, 771, 934 Set Service Login dialog box, 682 runtime, 1291, 1368 SetAccessControl(), 560, 805, 810 XML and, 934–942, 1291, 1368 SetAll(), 258, 259 Serialize(), 934, 935, 942 SetLastError, 724 server console application (Socket class), 662–663 sets, 255–256 server control event-booking example, 1164–1169 SetSample/Program.cs, 255 updating, 1169–1175 Setup Projects, 412 server controls. See ASP.NET server controls Setup Wizard, 412 Server Explorer, 476, 484, 486, 683, 684 SetValue(), 134, 135, 628, 629, 733, 739, 809, 810, 953 Server Explorer window, 393–394, 1170 SHA algorithms, 554 server-side controls, 18 Shakespeare’s plays, as XML fi les, 943 service behavior, 1294–1295 shallow comparison, 170 service confi guration program, 668, 670 Shape class, 986 service contracts, 1291, 1292–1293 ShapeDisplay class, 121 Service Control Manager (SCM), 669 shapes (WPF), 986–987. See also specifi c shapes

1458

bbindex.inddindex.indd 14581458 11/28/10/28/10 1:28:141:28:14 PMPM ShapesDemo/MainWindow.xaml – socket server (for Quote service)

ShapesDemo/MainWindow.xaml, 987 SilverlightDemos.Web/JavaScripInteropTestPage. shared assemblies, 15, 434, 445–454 , 1111, 1112 binding to, 453–454 SilverlightDemos.Web/RegistrationService.svc.cs, 1104 creating, 447 SilverlightDemos.Web/SilverlightDemosTestPage. GAC and, 15, 446–875 html, 1097 installing, 448 SilverlightDemos.Web/Web.confi g, 1104 publisher policy fi les and, 457–458 simple arrays, 129–132 references to, 450–451 simple controls (WPF), 994–995 removing, 451 Simple Object Access Protocol. See SOAP strong names and, 15, 445–448 Simple Service Discovery Protocol (SSDP), 1345 using, 448–449 Simple TCP/IP Services, 668, 671 versioning and, 454–458 SimpleCalculator, 749, 755, 759, 768 shared classes (ADO.NET), 818–819 SimpleCalculator/Calculator.cs, 750, 760, 761, 762 SharedDemo/SharedDemo.cs, 447 SimpleCalculator/Operation.cs, 750 shield icons, 1405–1406 SimpleContract/ICalculator.cs, 749 shopping cart application (discount application), SimpleContract/IOperation.cs, 749 300–302 SimpleCurrency2/Program.cs, 181 short, 33 SimpleCurrency/Program.cs, 173–174 ShowFonts/ShowFontsWindow.xaml, 1076 SimpleDelegate/MathOperations.cs, 188 sign assemblies, 567 SimpleDelegate/Program.cs, 189 signatures SimpleExceptions.cs, 356–357 delayed signing of assemblies, 449–450 SimpleHost/Program.cs, 751 ECDSA algorithm and, 554–556 Single (element operator), 276 SignIn(), 1352 single quotation mark (‘), escape sequence for, 35 signing in/signing out (PNM), 1352–1353 SingleLine, 220 SigningDemo/Program.cs, 555 single-line comments, 25, 53 SignOut(), 1352 SingleOrDefault, 276 Silverlight, 1095–1115 single-threaded apartments. See STAs browser integration, 1110–1113 sink object, 701, 720, 721–722 calling out to JavaScript, 1111 site local clouds, 1345 JavaScript calling Silverlight, 1112–1113 site map XML fi le (.sitemap), 1199–1200 DLR and, 295 site navigation (ASP.NET), 1198–1201 .NET Framework for, 1095, 1096 .sitemap. See site map XML fi le networking, 1102 SiteMapDataSource, 1162 networking example, 1102–1110 SiteMapPath, 1199 ADO.NET Entity Data Model, 1102 sizeof operator, 152, 155–156, 323 calling WCF Services, 1104–1107 skewing, 990 System.Net and, 1109–1110 SkewTransform, 990 using WCF Data Services, 1107–1109 Skip(), 276, 285, 879, 1068, 1071 WCF service for Silverlight clients, 1103–1104 SkipVerifi cation (permission set), 563 out-of-browser applications, 1113–1115 SkipWhile(), 276, 286 projects Sleep(), 492, 499, 1050 creating, 1097 Slider control, 995 navigation between pages, 1097–1101 smart client applications, 21, 380, 407, sandboxing and, 561 409, 983, 1117, 1385 WPF v., 1095–1097 Smart Device Cab Projects, 412 XAML and, 727, 728, 745 “smart pointer” class, 718, 719 Silverlight Application (project type), 380 SMTP, 652, 653, 656, 657, 658 Silverlight Class Library, 380 SmtpClient class, 656, 657–658 Silverlight Navigation Application, 380, 1097. See also sn - k mykey.snk, 447, 449 EventRegistration Snapshot (isolation level), 625 SilverlightDemos, 1097 SOAP (Simple Object Access Protocol), 1281 SilverlightDemos.Web, 1097 Socket class, 656, 661–665 SilverlightDemos.Web/EventRegistrationDataService client console application and, 663–664 .svc.cs, 1108 server console application and, 662–663 SilverlightDemos.Web/IRegistrationService.cs, 1103 socket server (for Quote service), 670, 671, 677

1459

bbindex.inddindex.indd 14591459 11/28/10/28/10 1:28:151:28:15 PMPM SocketPermission – stacks

SocketPermission, 563 as .NET runtime host, 956–957 SolicitColdCall, 362, 363, 365, 367, 369 Professional Microsoft SQL Server 2008 SolicitColdCall.cs, 365, 367 Programming, 955 SolidColorBrush, 991 provider, 832, 834, 860 Solution Explorer, 384, 385, 386 provider classes, 818 Solution Property Pages dialog box, 413 Query Analyzer, 851, 857 solutions security and, 956 defi ned, 383 stored procedures, 967–969 projects v., 383–386 System.Data.Sql, 818, 822 SomeMethod(), 316 System.Data.SqlClient, 818, 822, 866, 957, sort(), 136, 190, 191, 234, 235, 271 968, 969 sorted dictionaries, 254 System.Data.SqlTypes, 818 sorted lists, 246–247 UDTs with, 963 SortedDictionary‹TKey, TValue›, 254, 265, 266 user-defi ned functions and, 969–970 SortedListSample/Program.cs, 247 XML data types and, 972–980 SortedList‹TKey, TValue›, 246, 247, 254, 265, 266 SQLClientPermission, 563 SortedSet‹string›, 256 SqlCommand, 495, 599, 819, 852, 963, 967, 968 SortedSet‹T›, 255, 265, 266 SqlCommandBuilder, 819 sorting SqlConnection, 819 array elements, 136–139 SqlContext, 957, 968, 971 cultures and, 578–579 SqlCoordinate, 958–964 elements (in lists), 234–235 SqlDataAdapter, 819 Finnish sort example, 578 SqlDataReader, 819 sorting operators (query operator category), 275, SqlDataRecord, 957, 971 279–280 SqlDataSource, 1162 SortingDemo/Program.cs, 578 SqlFunctionAttribute, 957 SortingSample/Person.cs, 137, 138 SqlParameter, 819 SortingSample/Program.cs, 136, 137, 138, 139 SqlPipe, 957, 967, 968 source journaling, 1362 SqlProcedureAttribute, 957 Source property SqlSamplesUsingAdventureWorks/CalcHash.cs, 969 EventLog class, 478 SqlSamplesUsingAdventureWorks/ System.Exception, 359 GetCustomerOrdersCLR.cs, 968 SourceExists(), 478 SqlSamplesUsingAdventureWorks/InsertContact.cs, SourceFilter, 472 971 sp_ prefi x, 859 SqlSamplesUsingAdventureWorks/SampleSum.cs, 966 special folders, 1407 SqlTransaction, 819 SpecialFolder enumeration, 1407 SqlTrigger, 970 Specialization/Program.cs, 127 SqlTriggerAttribute, 957 specializations, generic methods and, 126–128 SqlTriggerContext, 957, 971 specifi c cultures, 571 SqlTypes/SqlCoordinate.cs, 960 SpecularMaterial, 1030 SqlUserDefi nedAttribute, 957 SpeedExport, 761, 762 SqlUserDefi nedType, 960 SpeedExportAttribute, 761 square brackets [ ] SpeedRatio, 1022 escape sequences and, 221 SpinLock struct, 522 pointers and, 330 splash (dialog box), 424 SSDL (Storage Schema Defi nition Language), 861, 863, Split(), 208 864, 865, 867, 884 SplitContainer control, 1139 SSDP (Simple Service Discovery Protocol), 1345 SQL Server, 955–980. See also T-SQL stack pointer, 308, 309, 310, 320 AdventureWorks database and, 955, 965, 967, 970 stackalloc command, 329–330 CLR and, 955–980 stack-based arrays, 329–331 Confi guration Manager, 669 StackOverfl owException, 352, 353 data types, 818 StackPanel, 999–1000 Enterprise Manager, 858 stacks, 240–241 key generation with, 857–858 as LIFO containers, 240

1460

bbindex.inddindex.indd 14601460 11/28/10/28/10 1:28:161:28:16 PMPM StackSample/Program.cs – StructuralComparison/Program.cs

memory allocation on, 308–311 EndOfStreamException and, 353 value types and, 8, 32, 308–309 reading from, 787 StackSample/Program.cs, 241 stream-related classes (hierarchy), 787–788 Stack‹T›, 240, 265 writing to, 787 StackTrace (System.Exception), 359 StreamWriter class, 787 Start(), 16, 184, 238, 239 constructing, 796–797 starting tasks, 501–502 in hierarchy of stream-related classes, 788 StartType property (ServiceInstaller class), 682 ReadWriteText sample, 797–799 StartupPath, 1119 String class (System.String), 35, 208–209 STAs (single-threaded apartments), 699, 710, 718, 719 methods (list), 208 state management, in ASP.NET, 1151 string concatenation, 208 StateService class, 1296 string concatenation operator (+), 151 StateService sample (WCF), 1295–1299 string type (reference type), 35, 36–37 client application and, 1297–1298 StringBuilder (System.Text.StringBuilder), 207, 210–212 error handling, 129–1299 members, 211–212 static (modifi er/keyword), 84, 100 methods, 212 static classes, 84 properties, 210, 211 static constructors, 75–77 StringCollection, 230, 797 static Equals(), 162 StringEncoder.cs, 209 static members, of generic classes, 117–118 StringExample.cs, 36 StaticClass, 297, 298 String.Format(), 86 StaticDemo‹T›, 117, 118 StringInfo, 570 StaticExtension (x:Static), 744 strings, 207–217 StaticPartitionerForArray‹TSource›, 290 building, 207, 209–212 StaticResource, 1006, 1007 format, 52, 212–217 StaticResourceExtension, 741, 742 formatting process (diagram), 215 Status (ServiceController class), 685 as immutable, 36, 70, 209 StatusBarItem, 995 regular expressions and, 218. See also regular stepping between languages, 7, 8 expressions Stop(), 649 Unicode characters and, 37 Storage Schema Defi nition Language. See SSDL strong data typing, 8–13 stored procedures C# and, 157 calling, 829–832 IL and, 8–13, 157 returns nothing, 829–831 language interoperability and, 8–9, 157 returns output parameters, 831–832 XML data types, 979–980 CLR, 967–969 strong name tool, 447 as commands, 825 strong names, 15, 445–448 in data adapter, 851 creating, 447–448 naming conventions, 859–860 culture and, 445 sp_ prefi x and, 859 integrity with, 446 SQL Server and, 967–969 strongly typed XML, 979–980. See also strong data triggers as, 970–972 typing T-SQL, 956, 967–969 StronglyTypedResourceBuilder, 583, 584 StoredProcedure, 826 StructLayout attributes, 334 StoredProcs.cs, 830, 831 structs, 80–82 StoredProcs.sql, 830, 831, 851, 857, 858 classes v., 65–66, 81–82, 90 storing entity changes, 882–883 constructors for, 82 Stream class, 787 fi elds and, 81 StreamReader class, 365, 366, 639, 660, 662 inheritance and, 82, 90 constructors and, 794–795 managed heaps and, 80, 87 in hierarchy of stream-related classes, 788 new keyword and, 66 new options, 794 pointers to, 323–324 ReadWriteText sample, 797–799 as value types, 81 streams, 353, 774, 787–788 StructuralComparison/Person.cs, 147–148 buffered, 788–789 StructuralComparison/Program.cs, 148, 149

1461

bbindex.inddindex.indd 14611461 11/28/10/28/10 1:28:161:28:16 PMPM StructuralObject – System.Data.Objects

StructuralObject, 870, 881 SyndicationFeed, 1388 structure scope, 308 SyndicationFeedFormatter, 1388 Students table, 607 SyndicationItem, 1388 Style class, 1008 SyndicationItemFormatter, 1388 styles (WPF elements), 1003–1004. See also resources SyndicationLink, 1388 Button element and, 1003–1004 SyndicationPerson, 1388 resources and, 1004 SyndicationReader/SyndicationReader.xaml, 1390 StylesAndResources/App.xaml, 1003, 1005, 1008 SyndicationReader/SyndicationReader.xaml StylesAndResources/MainWindow.xaml, 1003, 1005 .cs, 1389 StylesAndResources/ResourceDemo.xaml, 1006, SyndicationService/IFormula1Feed.cs, 1391, 1393 1007, 1008 syntax StyleSheetTheme, 1206 array, pointers and, 331 Subject (project property), 415 base.‹MethodName›(), 93 SubKeyCount, 810 C#, 25–26 Subset(), 144 Java, 25, 42 Substitution control, 1162 pointers, 319–320 Substring(), 208, 222 XAML, 728–732 subtracting pointers, 323 sysglobl, 601, 602 SUM, 964, 965 Sys.Services.AuthenticationService, 1241 Sum(), 276, 286 Sys.Services.Profi leService, 1241 ‹summary›, 54 Sys.Services.RoleService, 1241 SumOfSegments(), 140 system access control list (SACL), 559 supporting windows (Visual Studio 2010), 374 system queues, 1363 SupportPhone, 415 System.Activities, 744, 1316 SupportsWhatsNewAttribute, 338, 339, 345 System.Activities.Core.Presentation.dll, 1312 SupportURL, 415 System.Activities.Debugger, 744 svctraceviewer.exe, 474, 1290 System.Activities.dll, 1312 svcutil.exe, 1304, 1305, 1329 System.Activities.DurableInstancing, 1327 Swap‹T› (), 124 System.Activities.Presentation.dll, 1312 switch statements, 39–40 System.Activities.Presentation.View, 1319 default keyword and, 114 System.Activities.Statements, 728 switches (trace switches), 467, 469 System.ApplicationException, 353 symmetric key algorithms, 554 System.Attribute, 334 symmetric keys, 552–554 System.Boolean, 35 synchronization, 317, 514–533 System.Byte, 33 SynchronizationSamples/Job.cs, 515, 519 System.Char, 35 SynchronizationSamples/Program.cs, 516, 521 System.Collections, 108 SynchronizationSamples/SharedState.cs, 515, 518, System.Collections.ArrayList, 108 519, 520 System.Collections.Concurrent, 225, 262, 290 synchronous programming System.Collections.Generic, 108, 109, 578 asynchronous programming v., 1357 System.Collections.Specialized, 797 Message Queuing v., 1357–1358, 1362 SystemColors, 1005 syndication, 1387–1395 System.ComponentModel, 536, 586, 731, 870 API, 1389, 1390, 1394 System.ComponentModel.Composition, 747, 750, 765 Atom format and, 886, 1387, 1388, 1390, 1394 System.Confi guration.Install.Installer, 680 RSS and, 949–950, 1387, 1388, 1389, 1390, System.Convert, 176, 357 1393, 1394 System.Core, 253, 273, 294 System.SeviceModel.Syndication, 1387–1388, System.Data namespace, 818, 842, 860, 862 1391, 1394 shared classes in, 818 WCF and, 1387 System.Data.Common, 818, 819, 862, 1129 Syndication Feeds (sample), 1390–1394 System.Data.Common.CommandTrees, 862 Syndication Reader (sample), 1388–1390 System.Data.dll assembly, 832 Syndication Service Library template, 1390 System.Data.EntityClient, 818, 862 SyndicationCategory, 1388 System.Data.Entity.Design, 862 SyndicationContent, 1388 System.Data.Linq.SqlClient, 818 SyndicationElementExtension, 1388 System.Data.Objects, 862, 870

1462

bbindex.inddindex.indd 14621462 11/28/10/28/10 1:28:171:28:17 PMPM System.Data.Objects.DataClasses – System.Windows.Input

System.Data.Objects.DataClasses, 862, 870 System.Object, 84, 87, 89. See also Object class System.Data.Odbc, 818 SystemParameters, 1005 System.Data.OleDb, 818, 832 System.Refl ection, 344, 437, 455, 698 System.Data.ProviderBase, 818 System.Resources, 569, 580, 584, 603. See also System.Data.Services.Client, 894, 896, 1109 localization DataServiceContext and, 895, 896, 1109 System.Resources.Tools, 584 .NET applications and, 896–902 System.Runtime.CompilerServices, 295, 299 System.Data.Services.Common, 886 System.Runtime.InteropServices, 437, 708, 716, 726 System.Data.Services.DataServiceHost, 1304 System.Runtime.Serialization, 771, 1289, 1379 System.Data.Sql, 818, 822 System.Runtime.Serialization.Formatters.Binary, System.Data.SqlClient, 818, 822, 866, 957, 968, 969 639, 924 System.Data.SqlTypes, 818 System.Sbyte, 33 System.DateTime, 77, 79, 170, 212 System.Security.AccessControl, 559, 802, 803, 804 System.Decimal, 34 System.Security.Cryptography classes, 553, 554, 555, System.Delegate, 185, 193 556, 969. See also encryption System.Diagnostics, 375, 461, 643 System.Security.Permissions, 564, 956 System.Diagnostics.Contracts, 461, 492, 1051 System.ServiceProcess, 670, 676, 679, 684, 685 System.DirectoryServices, 562, 695 System.ServiceProcess.NativeMethods, 676 System.Double, 34 System.ServiceProcess.ServiceController, 683. See also System.Drawing, 77 ServiceController class System.Drawing.Rectangle, 68 System.SeviceModel.Syndication, 1387–1388, 1391, System.Dynamic, 295 1394. See also syndication System.EnterpriseServices transactions, 609, 610–611. System.Single, 34 See also transactions System.String, 35, 208–209. See also String class System.Enum, 45, 85 System.SystemException, 352–353 System.Exception, 352, 357, 358, 362, 364 System.Text, 207, 210, 343, 346 properties, 359–360 System.Text.RegularExpressions, 207, 218, 219, 222 SystemFonts, 1005 System.Text.StringBuilder. See StringBuilder System.FormatException, 358, 365 System.Threading, 184, 434, 533, 543, 546, 578, 1314 System.GC.Collect(), 312 System.Threading.Tasks, 501 System.GC.SuppressFinalize(), 317 System.Threading.Thread, 184 System.Globalization namespace, 569–570, 578, 601. System.Transactions, 605–636. See also transactions See also globalization System.Type, 85, 156 System.IDisposable. See IDisposable methods, 341–342 System.Int16, 33 properties, 340–341 System.Int32, 33 refl ection and, 85, 156, 340–342 System.Int64, 33 System.UInt16, 33 System.IntPtr, 317 System.UInt32, 33 System.IO, 637, 638, 639, 658, 659 System.UInt64, 33 classes in, 771 System.ValueType, 82, 84, 90, 163, 178 stream-related classes (hierarchy) in, 787–788 System.Web.UI.WebControls.WebControl, 18, 1192 System.IO.FileSystemWatcher, 768 system-wide resources (WPF), 1005 System.IO.MemoryMappedFiles, 799 System.Windows, 19, 203, 984 System.IO.MemoryStream, 787, 788 System.Windows.Annotations, 984 System.IO.Stream, 787 System.Windows.Automation, 984 System.Linq, 253, 272, 273, 287, 289, 294 System.Windows.Bam12006, 984 System.MarshalByRefObject, 444, 566, 772, 788 System.Windows.Browser, 1096, 1110 System.MulticastDelegate, 185, 193 System.Windows.Controls, 984 System.Net, 637, 638, 640, 642, 665 System.Windows.Converters, 984 System.Net.dll, 1346 System.Windows.Data, 984 System.Net.PeertoPeer, 1347–1352 System.Windows.Documents, 984 System.Net.PeertoPeer.Collaboration, 1352–1355 System.Windows.Forms, 777, 784, 793, 801, System.Net.Sockets 1118–1119 classes, 656 System.Windows.Forms.PropertyGrid, 392 networking and, 637, 656 System.Windows.Ink, 984 System.Net.Sockets.NetworkStream, 787 System.Windows.Input, 984

1463

bbindex.inddindex.indd 14631463 11/28/10/28/10 1:28:181:28:18 PMPM System.Windows.Interop – themes (ASP.NET)

System.Windows.Interop, 984 cancellation of, 507, 509–510 System.Windows.Markup, 728, 744, 985 continuation, 502–503 System.Windows.Media, 985 defi ned, 501 System.Windows.Media.Animation, 1020 hierarchies, 502–503 System.Windows.Media.Media3D, 1029 results from, 503–504 System.Windows.Navigation, 985 starting, 501–502 System.Windows.Resources, 985 TaskSamples/Program.cs, 501, 502, 503 System.Windows.Shapes, 985, 986 TaskWithResult, 503, 504 System.Windows.Threading, 985 TCP (Transmission Control Protocol), 637, 658 System.Windows.Xps, 985 classes, 658–660 System.Xaml, 728, 744 UDP v., 660 System.Xml namespace, 829, 903, 904–905 TcpClient class, 656, 673 System.Xml.Linq, 293, 903, 943, 944, 975 TCP/IP, 637 System.Xml.Serialization, 903, 934, 936, 1368 TCP/IP Services, Simple, 668, 671 System.Xml.XPath, 917–922 TcpListener class, 656, 658, 659, 660 System.Xml.Xsl, 922–927 TcpReceive application, 658–660 TcpSend application, 658–660 T TDD (test-driven development) models, 1243 Team class, 269 tab character (escape sequence), 35 TemperatureCalculatorExtension, 757 TabControl, 998, 1139–1140 TemperatureConversion user control, 755, 757 TabItem control, 997 TemperatureConversion/ Table class, 1082 TemperatureCalculatorExtension.cs, 757 Table control, 1161 TemperatureConversion/TemperatureConversion.xaml table per hierarchy (TPH), 873–874, 879 .cs, 756 table per type (TPT), 874–876 TemplateDemo/App.xaml, 1013 TableDemo/MainWindow.xaml, 1083 TemplateDemo/Countries.cs, 1016 TableDirect, 826, 850 TemplateDemo/Country.cs, 1015 TableLayoutPanel, 1138–1139 TemplateDemo/StyledButtonWindow.xaml, 1014, TableRow, 1082 1015, 1016 tables, 1082–1083 TemplateDemo/StyledListBoxWindow1.xaml CSS stylesheets v., 1198 .cs, 1017 naming conventions, 859 TemplateDemo/Styles.xaml, 1013, 1018, 1019 XML data types and, 972–973 templates (C++), 107. See also generics TabPages, 1139–1140 templates (WPF), 995, 1011–1020 tags, XML, 53–54 control templates, 1012–1014 Take(), 263, 276, 279, 285, 1068, 1071 types, 1012 TakesAWhile(), 492 Terminate(), 965, 966 TakesAWhileCompleted(), 494 ternary operator. See conditional operator TakesAWhileDelegate, 492, 494, 495 test-driven development (TDD) models, 1243 TakeWhile, 276 TestQuoteServer/Program.cs, 673 target journaling, 1362 /t:exe, 50 TargetPlatform (project property), 415 Text (CommandType), 826 TargetSite (System.Exception), 359 text boxes (dialog box), 424 TargetType, 1005 text editor (Visual Studio 2010), 373–374 task dialog, 1408–1411, 1415 text elements, 1075–1084 Task Parallel Library, 15 TextBox control, 643, 645, 651, 659, 995, taskbar (Windows 7), 1411–1415 1137–1138, 1160 TaskbarDemo/MainWindow.xaml, 1412 TextEffect, 1077–1078 TaskbarDemo/MainWindow.xaml.cs, 1414 TextEffectsDemo/MainWindow.xaml, 1078 TaskCanceledException, 510 TextWriterTraceListener, 470 TaskDialogDemo/app.manifest, 1409 TheBigClass, 81, 82 TaskDialogDemo/MainWindow.xaml.cs, 1410 Theme attribute, 1206 TaskFactory, 475, 501, 502, 509, 527, 530 themes (ASP.NET), 1206–1210 tasks, 501–504 applying to pages, 1207

1464

bbindex.inddindex.indd 14641464 11/28/10/28/10 1:28:191:28:19 PMPM ThenBy() – TransactedFile

defi ning, 1207 /t:library, 50 in PCSDemoSite, 1208–1210 /t:module, 50 ThenBy(), 279, 280, 281 ToArray(), 274 ThenByDescending(), 275, 279 ToArray (conversion operator), 276 thick-client applications, 19 ToDictionary, 276 this keyword ToEnumerable(), 274 constructors and, 78, 96 ToggleButton, 995 extension methods and, 87, 272 ToList, 276 instance fi eld and, 31 ToLongDateString(), 573, 574 member fi elds and, 75 ToLookup(), 253, 254, 276, 288 Thread class, 495–499 ToLower(), 208 thread pools, 492, 499–501 ToolBar control, 998 thread priority, 498–499 ToolBarPanel, 999 ThreadingIssues/Program.cs, 513 ToolStrip control, 1140 –1141 ThreadingIssues/SampleTask.cs, 511, 512, 513, 514 ToolStripButton, 1140 ThreadPoolSamples/Program.cs, 500 ToolStripContainer control, 1142 threads, 184, 238, 317, 491–543. See also ToolStripControlHost, 1140–1141 synchronization ToolStripDropDownItem, 1140–1141 background, 497–498 ToolStripLabel, 1140 concurrent collections and, 264 ToolStripManager, 1141–1142 controlling, 499 ToolStripMenuItem, 1141 dependent transactions and, 617 ToolStripSeparator, 1140 guidelines for, 543 ToolTip, 995 issues with, 510–514 Top(), 879 Main() and, 492 ToString(), 33, 36, 84, 85–86, 212, 214, 215, MTAs and, 501, 699–700, 710, 718 227, 251 overview of, 492 IFormattable and, 214 Parallel class and, 504–507 overriding, 36, 82, 85 passing data to, 496–497 StringBuilder and, 212 reasons for, 491 ToUpper(), 208, 216, 227 safety. See lock statement TPH. See table per hierarchy STAs and, 699, 710, 718, 719 TPT. See table per type tasks and, 501–504 trace listeners, 467, 470–471 Windows Services and, 13 TRACE preprocessor symbol, 397 ThreadSamples/Program.cs, 496, 497, 498 trace sources, 467, 468–469 Thread.Sleep(), 492, 499, 1050 trace switches, 467, 469 ThreadStart, 238, 495 trace viewer, 473 3-D book model, 1030–1033 Trace Viewer tool, Service, 474, 1290 3-D with WPF, 1029–1033 TraceFilter, 467, 472 3DDemo/MainWindow.xaml, 1030, 1032 TraceListener, 470 three-dimensional arrays, 133 TraceListenerCollection, 467 throwing an exception, 354 TraceSource class, 468, 1399 throwing user-defi ned exceptions, 364–367 tracing, 461, 467–475 TicTacToe game, 145 architecture, 467 tiered development, 856–857 classes for, 467 time quantum, 498 correlation and, 472–475 Timeline, 1020–1023 editor application and, 1399 TimeOfDay enum, 44, 45 fi lters and, 471–472 Timer classes, 533–534 WCF and, 1289–1290 Timer control (ASP.NET AJAX), 1223 TracingDemo/App.confi g, 469, 470, 471, 472, 473 timers, 533–534 TracingDemo/Program.cs, 468, 469, 473 TimerSample/Program.cs, 534 trackers, 1342 Title (project property), 415 traditional transactions, 609–611. See also tlbexp utility, 714, 726 transactions tlbimp utility, 707, 726 TransactedFile, 634, 635

1465

bbindex.inddindex.indd 14651465 11/28/10/28/10 1:28:191:28:19 PMPM Transaction class – typeof operator

Transaction class event, 1020, 1023–1025 methods, 611–612 Expander control and, 997 properties, 611–612 Message Queueing and, 1360 transaction manager, 606 WPF, 1008–1111 transactional queues, 1377–1378, 1382, 1385 TrimExcess(), 228, 237 transactional resources, 627–632 Trust Manager, 422 TransactionAutoComplete, 1298 Trusted Application Deployment, 421 TransactionAutoCompleteOnSessionClose, 1294 Trusted Publishers, 568 TransactionCompleted event, 612, 618 Trusted Root Certifi cation Authorities, 568 TransactionInformation property, 611 try blocks, 314, 353–355 TransactionIsolationLevel, 1294 nested, 360–362 transactions (System.Transactions), 605–636 try...catch...fi nally blocks, database connections and, ACID properties and, 607, 635 822–823 ADO.NET transactions v., 609–610. See also ADO TryFindResource(), 1006 .NET TryGetMember(), 303 ‘all or nothing’ characteristic of, 605 TryGetObjectByKey(), 873, 882 ambient, 618–624, 635 TryGetValue(), 247, 253, 263 multithreading with, 621–624 TryInvokeMember(), 303 nested scopes with, 620–621 TrySetMember(), 303 automatic, 610, 611, 636, 1279 T-SQL. See also Entity SQL committable, 612–614 Entity SQL and, 866, 867, 868 components of, 606 stored procedures, 956, 967–969 dependent, 616–618 XQuery expressions and, 980 isolation level and, 624–626, 824–825 tunneling events, 201, 736–739 overview, 605–606 tuples, 129, 146–149, 226, 503, 504, 529 phases of, 606 arrays v., 147–149 promotable, 614–616 F# and, 146 System.EnterpriseServices transactions v., 609, TaskWithResult and, 503, 504 610–611 TuplesSample/Program.cs, 146 transaction scope, 824–825 /t:winexe, 50 with Windows 7/ Windows Serve 2008, 632–635 Two(), 195 TransactionSamples/Program.cs, 614, 615, 617, 619, two-dimensional arrays, 132, 133 620 Type class. See System.Type TransactionScope, 618, 619, 620, 625, 635, 824 type conversions, 158–161. See also casting TransactionScopeOption, 620, 621, 626 collections and, 235–236 TransactionScopeRequired, 1298 explicit, 159–161 TransformationDemo/MainWindow.xaml, 990 implicit, 158–159 transformations (WPF), 990 type safety and, 157 TransformGroup, 990 type converters, 731 transforms, 922–927 type inference, 28 debugging, 925–927 type information operator, 152 transforming XML, XsltArgumentList, 923–925 type library XML data store and, 927 COM and, 696 TranslateTransform, 994 for .NET component, 714–716 Transmission Control Protocol. See TCP type safety. See also strong data typing transparent code, 561 generics and, 107, 109 TreeView control, 998, 1063–1067, 1199 IL and, 11, 12, 157 TreeViewItem, 998 memory type safety, 13, 22 Trigger class, 1009 pointers and, 8, 318 TriggerDemo/Book.cs, 1010 type conversions and, 157 TriggerDemo/DataTriggerWindow.xaml, 1011 unsafe code, operators, 152 TriggerDemo/MultiTriggerWindow.xaml, 1010 TypeCatalog, 768 TriggerDemo/PropertyTriggerWindow.xaml, TypeConverter, 730, 731 1009 TypeExtension (x:Type), 744 triggers, 970–972. See also specifi c triggers typeof operator, 45, 152, 156, 340

1466

bbindex.inddindex.indd 14661466 11/28/10/28/10 1:28:201:28:20 PMPM types – user-defi ned exception classes

types. See CTS types; data types; generic types; UNIX, 17, 59, 217 reference types; value types unmanaged C++, 6, 11 TypeView example, 342–344 unmanaged resources freeing, 312–313 U working with, 307 unmanaged types, 320 UAC (user account control), 1397, 1398, 1404–1406, unpinning/pinning windows, 394 1415 unsafe (safety level), 956 administrative privileges and, 1404–1405 unsafe code shield icons and, 1405–1406 anonymous methods and, 197 uCreditCard, 970 operators and, 152 UDP (User Datagram Protocol), 660 pointers and, 317–319. See also pointers class for, 661 unsafe keyword, 318–319 ports, 1345 Unspecifi ed (isolation level), 625 TCP v., 660 UPDATE, 819, 826, 830, 838, 850, 860, 971 UdpClient class, 656, 661 update constraints, 843–844 UDTClient/Program.cs, 964 UpdatePanel controls, 1222, 1229–1231 UDTs (user-defi ned types) UpdateProgress control, 1222, 1231 from client-side code, 963–964 UpdateRowSource, 832, 853 creating, 958–963 updates (ADO.NET Entity Framework), restriction for, 964 879–884 with SQL Server, 963 attaching/detaching entities, 882 Uid attributes, 594, 596–597 change information, 881–882 UIElement, 986, 999 object tracking, 880 uint, 33 storing entity changes, 882–883 casting Upgrade Wizard (Visual Studio 2010), 376 fl oat to uint, 175 UpgradeCode, 415 uint to fl oat, 174 UploadData(), 639 UIPermission, 563 UploadFile(), 639 ulong, 33 uploading fi les (with WebClient class), 639–640 unary operators, 156, 157, 172, 319 Uri class, 653–654 unboxing, 108, 111, 161, 178–179 UriBuilder class, 653–654 unchecked operator. See checked/unchecked operators URIs (Uniform Resource Identifi ers) #undef, 55–56 defi ned, 638 UnderlyingSystemType (System.Type), 341 utility classes and, 653–654 underscore URL operation routing, 1266–1267 fi elds and, 61, 73 URL queries, to WCF Data Services, 893–894 identifi ers and, 58, 59 URLs (Uniform Resource Locators), 638 joining names with, 60 usage conventions, 59–64. See also naming UnexpectedException, 363, 366, 367, 368 conventions unhandled exceptions, 360 user account control. See UAC Unicode characters user controls char and, 35 ASP.NET, 1155, 1186–1191 identifi ers and, 59 Windows Forms, 1147 strings and, 37 User Datagram Protocol. See UDP System.Globalization and, 570 user interaction, controls and, 1124 Unicode-based formats, 794, 795, 797, 798 user interface (ASP.NET AJAX Library layer), 1223 Uniform Resource Identifi ers. See URIs User Interface editor, 423–424 Uniform Resource Locators. See URLs user interfaces, Windows Forms and, 21 UniformGrid, 1002 UserControl class, 996 Uninstall(), 679, 680, 683 user-defi ned aggregates, 964–967, 980 Union(), 276, 283, 879 creating, 965–966 UnionAll(), 879 using, 966–967 UniqueConstraint, 842, 843 user-defi ned casts, 172–182 universal unique ID (UUID), 703, 1363, 1364 user-defi ned exception classes, 362–369

1467

bbindex.inddindex.indd 14671467 11/28/10/28/10 1:28:211:28:21 PMPM user-defi ned exceptions – virtual properties

user-defi ned exceptions outside of Lambda expressions, 199 catching, 363–364 workfl ows and, 1322–1323 throwing, 364–367 Variance/IDisplay.cs, 121 user-defi ned functions, 969–970 Variance/IIndex.cs, 119 user-defi ned integer types. See enumerations Variance/Program.cs, 120, 121 user-defi ned types. See UDTs Variance/RectangleCollection.cs, 120 UseSynchronizationContext, 1295 Variance/Rectangle.cs, 119 ushort, 33 Variance/Shape.cs, 119 using clause, 823–824, 860 Variance/ShapeDisplay.cs, 121 using keyword VARIANT, 698, 701 aliases and, 47 Vector class, 32, 337, 339, 341 namespaces and, 25, 46–47 Vector Struct (operator overloading example), using namespace statement (C++), 25 165–171. See also FormattableVector using System statement, 47 VectorAsCollection sample, 337, 339 UsingSP/Program.cs, 968 vector-based WPF, 990 UTF7, 794, 795 VectorClass assembly (WhatsNewAttributes), 337, UTF8 encoding, 794, 795, 796, 811, 812 339–340 UTF32, 794, 795 VectorEnumerator, 340, 349 Utilities class, 612 vectors Utilities/Utilities.cs, 612 adding, 165–166 UUID (universal unique ID), 703, bit vectors, 260–262 1363, 1364 comparing, 170–171 uuidgen.exe utility, 1363 multiplying, 168–169 VectorStruct solution, 166 V VectorStructMoreOverloads.sln, 168 Version (project property), 415 ValidateMustUnderstand, 1295 versioning validation data contracts and, 1292 activity validation, 1317 shared assemblies and, 454–458 web server controls, 1163–1164 versions WPF and, 1057–1061 assemblies with XmlReader, 910–911 binding to, 456–457 ValidationSummary, 1163, 1164, 1165, 1168 programmatically getting, 455–456 ‹value›, 54 version numbers, 455 value changed callbacks, 735–736 CLR value conversion (WPF), 1051–1057 fi lenames and, 409 VALUE index, 978 installing/using multiple versions, 458 value types, 308–309 vertical tab (escape sequence), 35 defi ned, 8 View (container for controls), 1161 memory management and, 307–309 view (MVC framework), 1260. See also MVC predefi ned, 33–35 Viewbox, 998, 999 reference types v., 8, 32–33 viewing assemblies, 434–435 stack and, 8, 32, 308–309 Views directory, 1261 structs as, 81 virtual (modifi er), 100 ValueCount, 810 virtual address space. See virtual memory var keyword virtual addressing, 308 dynamic programming (C#) and, 295 virtual Equals(), 162 dynamic type and, 296 virtual keyword, 91, 93 new keyword and, 79 virtual memory (virtual address space), 11, 308 type inference and, 28 allocation Var.cs, 28 on heap, 309–311 variable scope, 29–31 on stack, 308–311 variables application domains and, 12–13 declaring, 26–31 processes and, 11–12 initialization of, 27 virtual methods, 91–92 naming conventions, 60–63 virtual properties, 91–92

1468

bbindex.inddindex.indd 14681468 11/28/10/28/10 1:28:211:28:21 PMPM virtual table (vtable) – WCF (Windows Communication Foundation)

virtual table (vtable), 697, 698 Server Explorer window, 393–394, 1170 VirtualDirectory, 419 supporting windows, 374 visibility modifi ers, 66, 99 text editor, 373–374 Visual Basic 6, 5, 8, 16, 18, 19 Upgrade Wizard, 376 COM component creation and, 702 Visual Studio 2010 and, 375 MTAs and, 700 WF applications in, 405–406 Visual Basic 2010 WPF applications in, 404–405 CLS-compliant code and, 9 VisualBrush, 993–994 .NET Framework and, 5 visuals, printing, 1092–1093 Visual Basic.NET, 5, 61, 62, 100 VisualStateDemo/MainWindow.xaml, 1029 Visual C++ 2010, .NET Framework and, 5–6 VisualStateGroups, 1027, 1028, 1029 Visual class, 986 void pointers, 321 Visual InterDev, 18 voltage levels, 657 Visual State Manager, 1026–1029 VolumeSeparatorChar, 775 Visual Studio 2010, 373–406 vtable (virtual table), 697, 698 Add Service Reference, 1304, 1305 add-ins and, 747 W Aggregate template, 966 W3C (World Wide Web Consortium) Build Deploy Project menu, 963 DOM Level 1,DOM Level 2, 904, 913 Class View window, 392–393 XML 1.0 namespace recommendations, 906, 912 code contracts and, 462 XML standards support (in .NET), 904 command prompt, 24 XmlDocument, 905 compiling XQuery and, 977 from within environment, 374–375 W3SVC service registry confi guration, 679 unsafe code, 319 wait handles, 493–494, 495, 522–523 Conversion Wizard, 376 WaitAny(), 522, 527, 1314 debugging in, 375, 398–401 WaitHandle class, 515, 522, 526, 527, 1314 deployment and, 407–427. See also deployment #warning, 57 design view editor, 374, 388 WAS (Windows Activation Services), 1287, 1302, 1303, Design View window, 388–391 1308 document window, 376, 398, 402, 405 watches, 375, 399–400 editors, 422–427 WCF (Windows Communication Foundation), features, 373–375 20, 1279–1308. See also Message Queuing; folding editor feature, 386–388 syndication; WCF Data Services; Workfl ow 4 installer project types, 408, 412 binding and, 1300–1302 IntelliSense, 44, 60, 115, 374, 375, 388, 709, 1128, client applications and, 1304–1305 1155, 1157, 1189, 1234, 1239 components in, 1280 language independence, 385 contracts and, 1291–1294 localization and, 584–591 Course Order application and, 1378–1384 MSDN documentation and, 375 custom service hosts, 1287 multi-targeting .NET Framework 4 with, 375, encryption and, 545 403–404 features of, 1280 Object Browser window, 393 hosting and, 1302–1304 projects IIS and, 1302, 1303 building, 394–398 JSON and, 1282 coding, 386–394 mapped-memory fi les and. See mapped-memory fi les creating, 378–386 markup extensions and, 744 deployment, 408, 412 Message Queuing with, 1378–1385 dialog boxes for, 424 network protocols and, 637 fi les in, 382–383 overview, 1279–1282 setup, 412 REST and, 1281, 1282 solutions v., 383–386 service implementation, 1294–1299 types, 379–381 simple service and client (RoomReservation service), Properties window, 391–392 1282–1290 refactoring with, 401–403 SOAP and, 1281 Server Explorer, 476, 484, 486, 683, 684 StateService sample, 1295–1299

1469

bbindex.inddindex.indd 14691469 11/28/10/28/10 1:28:221:28:22 PMPM WCF (Windows Communication Foundation) – Wiley Publishing

WCF (Windows Communication Foundation) ASP.NET, 1150–1151 (continued) navigation, 1198–1201 syndication and, 1387 security, 1201–1206 tracing and, 1289–1290 publishing, 408, 411 WCF Data Services and, 886, 889 WebApplication/MultiLanguage.aspx, 592 WSDL and, 1281, 1290, 1291, 1292, 1304, 1305 WebApplication/Web.confi g, 592 WCF Data Services, 885–902 WebBrowser control, 637, 643–652 ADO.NET Entity Framework and, 885–886, 894–895 COM and, 643 data service context, 886, 896–897, 902 displaying code of requested page with, 651–652 adding/modifying/deleting entities, 900–901 examples DataServiceContext, 895, 896, 1109 browsing inside applications, 643–645 object tracking and, 900 displaying output as HTML page, 643 operation batching and, 901–902 IE-type features for application, 645–650 hosting with CLR objects, 886–890 launching Internet Explorer instances, 645 HTTP client application, 891–893 printing with, 651 LINQ queries and, 897–898, 902 WebClient class, 638–640 networking example. See networking example asynchronous event pattern and, 535 observable collections and, 898–899 downloading fi les with, 638–639 overview of, 885–886 uploading fi les with, 639–640 URL queries to, 893–894 WebClient project, 409 WCF and, 886, 889 Web.confi g (ASP.NET MVC), 1261 WCF Service Application, 381 WebHttpBinding, 1300 WCF Service Host, 1284–1286, 1287, 1393 WebInvoke, 886 WCF Service Library, 381, 1283, 1284, 1303, 1380 WebPartManager, 1211 WCF Test Client, 1284–1286 WebPartZone, 1211 WCFRegistration/MainPage.xaml, 1098 WebPermission, 563 WCFRegistration/Views/Home.xaml, 1105, 1106 WebRequestClient/WebRequestClient.xaml.cs, 892 WCFRegistration/Views/Welcome.xaml, 1099 WebRequest/WebResponse classes, 640–643, 665. WCFRegistration/Views/Welcome.xaml.cs, 1101 See also HttpWebRequest; HttpWebResponse weak events, 203–205 asynchronous page requests and, 642–643 WeakEventsSample/Consumer.cs, 205 asynchronous programming and, 535 WeakEventsSample/Program.cs, 205 authentication and, 642 WeakEventsSample/WeakCarInfoEventManager.cs, hierarchy of, 652–653 204 proxy servers and, 642 web applications (ASP.NET), 1150–1151 welcome (dialog box), 424 Copy Web Tool and, 411 well-connected clouds, 1342 defi ned, 1181 WER (Windows Error Reporting), 567, 1398 security, 1201–1206 WF. See Workfl ow 4 xcopy and, 411 WhatsNewAttributes, 337–340, 345–349 Web Forms (ASP.NET), 18, 1149, 1151–1154 completion of, 345–349 Windows Forms v., 19 library assembly, 338–339 web method calls, asynchronous, 1240–1241 VectorClass assembly, 337, 339–340 web methods, 1240 WhatsNewAttributes.cs, 339 Web Parts, 1210–1218 WhatsNewChecker, 346 controls, 1211–1212 Where(), 272, 273, 275, 277, 279, 281, 289, 290, 291, functionality of, 1210 294, 878, 879 PCSWebParts example, 1212–1218 where clause, 115, 116, 125, 277, 278, 280, 283, 289 web server controls (ASP.NET), 18, 1155 where T: class, 116 data web server controls, 1162–1163 where T: Foo, 116 dynamic data controls, 1162, 1163 where T: IFoo, 116 list of, 1160–1162 where T: new(), 116 login, 1203–1204 where T: struct, 116, 122 navigation, 1198–1201 where T1: T2, 116 validation web server controls, 1163–1164 while loops, 42 Web Setup Projects, 412 Wiley Publishing web sites Beginning Regular Expressions, 218

1470

bbindex.inddindex.indd 14701470 11/28/10/28/10 1:28:231:28:23 PMPM WinCV utility – workfl ows

Professional ASP.NET4: in C# and VB, 247, guidelines, 1397–1415. See also Windows 7 1156, 1181 Message Queuing. See Message Queuing Professional Microsoft SQL Server 2008 transactions with, 632–635 Programming, 955 Windows Services (formerly NT Services), 20, 381, Professional XML, 904 667–693 WinCV utility, 16 administration tool, 668 Window class, 996 architecture, 668–670 Window element, 1005 classes for, 670 Window_Loaded(), 1350, 1354 creating functionality for, 671 Windows 7 defi ned, 667–668 Client Software Logo document, 1398 event logging, 692–693 command link controls, 1407–1408 HKEY_LOCAL_MACHINESystemCurrentControl directory structure, 1406–1407 SetServices and, 679 Easy Connect, 1346 installer classes (class diagram), 679 guidelines, 1397–1415 MMC snap-in, 616, 669, 683 Jump Lists, 1411, 1414–1415 performance counters and, 484, 486 Message Queuing. See Message Queuing Quote service. See Quote service PNRP in, 1345–1346 threads and, 679 taskbar, 1411–1415 troubleshooting, 692 transactions with, 632–635 xcopy installation and, 670 UAC, 1397, 1398, 1404–1406, 1415 Windows socket API functions, 637 Windows Activation Services (WAS), 1287, 1302, Windows Software Logo Kit, 1398 1303, 1308 Windows Workfl ow Foundation 3.0 (online Chapter 57), Windows API Code Pack, 1397–1398, 1402, 1407, 1309 1408, 1410, 1415 Windows Workfl ow Foundation 4. See Workfl ow 4 Windows Authentication, 820, 1201 Windows1.xaml.cs, 301 Windows CardSpace, 404 Windows7Transactions/Program.cs, 638 Windows Communication Foundation. See WCF WindowsFormsCommandLink/Form1.Designer.cs, 1408 Windows Controls, 19 Windows-integrated security, 820 Windows Error Reporting (WER), 567, 1398 WindowsPrincipal/Program.cs, 546 Windows Forms, 19, 1117–1147 winres.exe, 591 applications WithCancellation(), 290 localization and, 584–591 WithDegreeOfParallelism(), 290 MDI-type, 78, 1141, 1142, 1146 WithExecutionMode(), 290 project template, 380 WithoutSchema.xml, 854, 855 simple example, 1117–1122, 1142 Wizard control, 1161 class hierarchy, 1122 Workfl ow 4 (WF/ Windows Workfl ow Foundation 4), Control class, 1122–1125. See also controls 20, 1309–1337 Form class, 1142 applications, in Visual Studio 2010, 405–406 forms, 1142–1146 Designer rehosting, 1332–1337 performance counters and, 486 Hello World example, 1310–1311 user interfaces and, 21 markup extensions and, 744 Web Forms v., 19 XAML and, 727, 728, 744, 745 Windows Forms Control Library, 379, 380 Workfl ow Console Application, 381, 405, 1310 Windows Forms Designer, 585, 586, 589, 591 Workfl ow Designer. See Designer rehosting Windows functionality, controls and, 1125 Workfl owApplication class, 1323–1327 Windows Installer technology, 408, 412. See also Workfl owExecutor, 1322, 1323 installation packages Workfl owInvoker, 1311, 1322, 1323, 1336 ClickOnce v., 420 workfl ows, 1322–1332. See also activities SDK, 412 as activities, 1311 Visual Studio 2010 installer project types and, arguments and, 1322–1323 408, 412 bookmarks and, 1324–1325 Windows Presentation Foundation. See WPF defi ned, 1311 Windows Resource Localization Editor, 591 extensions and, 1325–1326 , 668 hosting, 1327 Windows Server 2008 reloading, 1326

1471

bbindex.inddindex.indd 14711471 11/28/10/28/10 1:28:231:28:23 PMPM Workfl owServiceHost – XAML (Extensible Application Markup Language)

Workfl owServiceHost, 1327–1332 WPF User Control Library, 380, 755 Workfl owXamlServices, 744 WPF User Controls, 755, 757, 762 World Wide Web Consortium. See W3C WPFApplicationUsingResources/MainWindow.xaml, World Wide Web Publishing Service, 668 593, 594 WPF (Windows Presentation Foundation), 19. WPFApplicationUsingXAMLDictionaries/ See also Silverlight AssemblyInfo.cs, 595 applications, in Visual Studio 2010, 404–405 WPFApplicationUsingXAMLDictionaries/ business application features, 1035–1073. See also LocalizationStrings.xaml, 595 BooksDemo application; Formula-1 sample WPFApplicationUsingXAMLDictionaries/ database MainWindow.xaml, 596 commanding, 1061–1063 WPFApplicationUsingXAMLDictionaries/ data binding, 1035–1051 WPFApplicationUsingXAMLDictionaries.csproj, DataGrid control, 1067–1073 595 TreeView control, 1063–1067 WPFCalculator, 762, 765 validation, 1057–1061 WPFCalculator/CalculatorExtensionImport.cs, 763 value conversion, 1051–1057 WPFCalculator/CalculatorImport.cs, 764 class hierarchy, 985–986 WPFCalculator/MainWindow.xaml.cs, 764, 765, classes in, 983, 984, 985–986 766, 768 core, 983–1033 WPFCommandLink/MainWindow.xaml, 1408 dependency properties, XAML and, 732–736 WrapPanel, 1000, 1019 documents and, 1075–1094. See also documents WriteAllBytes(), 786 features WriteAllLines(), 786, 787 animations, 1020–1029 WriteAllText(), 786 brushes, 991–994 WriteAttributeInfo(), 348 controls, 994–999 WriteEntry(), 478, 479, 483 geometries, 988–989 WriteEvent(), 478, 479, 483 layout containers, 999–1002 write-only properties, 73 resources, 1004–1008 WriteXml(), 854, 928, 929, 931, 932 shapes, 986–987 writing custom attributes, 334–337 styles, 1003–1004 writing event log entries, 479 templates, 995, 1011–1020 writing to fi les, 784–787 3-D features, 1029–1033 binary fi les, 789–793 transformations, 990 text fi les, 793–799 triggers, 1008–1111 writing to isolated storage, 810–814 localization and, 593–598 writing to registry, 806–810 markup extensions and, 744 writing to streams, 787 namespaces in, 984–985 writing to XML documents, 952–953 .NET resources and, 594 writing XAML, 744–1173 overview, 983–985 WroxDynamicObject, 303, 304 performance counters and, 486 WS2007HttpBinding, 1300 Silverlight v., 1095–1097 WSDL (Web Services Description Language), 1281, trace sources and, 467 1290, 1291, 1292, 1304, 1305 type converters, XML attributes and, 731 WSDualHttpBinding, 1300 vector-based, 990 WSFederationHttpBinding, 1300 weak event pattern and, 204 WSHttpBinding, 1300 XAML and, 19, 727, 728, 731, 732, 734, 736, 738, WSHttpContextBinding, 1300 744, 745, 983 WPF Application (project type), 380 X WPF Browser Application (project type), 380 WPF Custom Control Library, 380 X (hexadecimal format), 52, 213 WPF editor application, 1398–1403 XAML (Extensible Application Markup Language), EditorDemo/App.xaml.cs, 1400 727–745 EditorDemo/CurrentFile.cs, 1399 attached properties and, 739–741 EditorDemo/MainWindow.xaml.cs, 1401 bubbling events and, 201, 736–739 tracing and, 1399 collections and, 731–732

1472

bbindex.inddindex.indd 14721472 11/28/10/28/10 1:28:241:28:24 PMPM XAML resource dictionaries – XmlReader

constructors and, 732 objects, 943–948 custom .NET classes and, 3–4 Professional XML, 904 data binding with, 1037–1039 RSS and. See RSS data types and, 5 schemas (XSD), 844–850 dependency properties and, 732–736, 739 serializing objects in, 934–942, 1291, 1368 generic collection classes and, 732 Shakespeare’s plays in, 943 generics and, 728, 732, 744 standards, .NET and, 904 markup extensions and, 741–744 System.XML namespace, 904–905 overview, 727–728 tags, 53–54 reading, 744–745 Xml (text display control), 1161 Silverlight and, 727, 728, 745 XML Data Modifi cation Language (XML DML), syntax, 728–732 977–978 elements map to .NET objects, 728–729 XML data store, transforms and, 927 properties as attributes, 730–731 XML data types, 972–980 properties as elements, 731 querying, 976–977 tools for creating, 727 reading values, 973–976 tunneling events and, 201, 736–739 strongly typed, 979–980 WF and, 727, 728, 744, 745 XML DML and, 977–978 WPF and, 19, 727, 728, 731, 732, 734, 736, 738, 744, XML DML. See XML Data Modifi cation Language 745, 983 XML documents writing, 744–745 querying XAML resource dictionaries, 594–598 dynamic XML documents, 949–951 XAML view (document window), 405 static XML documents, 948–949 XamlDebuggerXmlReader, 744 reading from, 951–952 XAML-defi ned markup extensions, 744 writing to, 952–953 XAMLIntro/App.xaml, 729 XML indexes, 978–979 XAMLIntro/MainWindow.xaml, 729, 730 XML Paper Specifi cation. See XPS XamlObjectWriter, 744 XML serialization, 934–942, 1291, 1368 XAMLPad.exe tool, 1078 XML Web Services, 18–19, 21, 373 XamlReader, 728, 744 XmlAttribute, 913, 934 XamlServices, 744 XmlAttributeOverrides, 940, 941, 942 XAMLSyntax/MainWindow.xaml, 730, 731, 732 XmlAttributes, 940, 941, 942 XamlWriter, 728, 744 XmlCDataSection, 913 XamlXmlWriter, 744 XmlComment, 913 x:Array, 732, 744 XmlDataDocument, 905, 914, 922, 927, 929, XAttribute, 947–948 930, 931 XComment, 946–947 XmlDataSource, 1162 xcopy deployment, 408, 410–411, 412, 452 XmlDeclaration, 913, 917 xcopy installation, 15, 670 XmlDocument, 471, 905, 914–917 XDocument, 943 XmlDocumentFragment, 913 XElement, 944 XmlDocumentType, 913 XML (Extensible Markup Language), 903–954 XMLDOM.cs (code snippet), 914, 915 ADO.NET and, 844, 927–934 XmlElement, 913, 915, 916, 917, 934 converting ADO.NET data to XML, 927–932 XmlEntity, 913 converting XML to ADO.NET data, 932–934 XmlEntityReferenceNode, 913 Ajax and, 1220 XMLHttpRequest, 1220 attributes, type converters (WPF) and, 731 XmlLinkedNode, 913 binding to, 1055–1057 XmlNode, 905, 906, 915, 917, 928, 974 documentation, 53–55 XmlNodeList, 905, 913, 914, 915 LINQ to XML, 293, 942–943, 954 XmlNotation, 913 CRUD operations, 954 XmlnsDefi nition, 730 helper objects, 943–948, 954 XmlProcessingInstruction, 913 querying dynamic XML documents, 949–951 XmlQueryOutput, 906 querying static XML documents, 948–949 XmlReader, 904, 906–911 .NET Framework and, 903, 904, 942–943 read methods, 907–909

1473

bbindex.inddindex.indd 14731473 11/28/10/28/10 1:28:251:28:25 PMPM XmlReader – Zip()

XmlReader (continued) XpsDocumentWriter, 1090, 1091, 1092, 1093 retrieving attribute data, 909–910 XQuery, 977 validating with, 910–911 XQuery Update Facility 1.0, 978 XMLReaderSample.sln, 907, 909, 911, 912 XSD (XML schema defi nition fi le), 844–850 XmlResolver, 905, 922 XSD tool (XSD.EXE), 844, 845, 849, 860 XmlSamples/Program.cs, 975 XSDDataSet.cs, 850 XmlSerializer, 934, 938, 941 XslSample01.sln, 922, 923 XmlSignifi cantWhitespace, 913 XSLT, 903, 904, 922 XmlText, 913 debugging, 925–927 XmlTextReader, 813, 814, 904, 906, 908, 911 editor, 926 XmlTextWriter, 811, 812, 904, 906, 911, 916, 923 style sheet, 1161 XmlUrlResolver, 905 System.Xml.Xsl, 922–927 XmlValidatingReader, 906, 918 x:Static, 744 XmlWhitespace, 913 x:Type, 744 XmlWriter, 904, 911–913 x:TypeArguments, 732 XmlWriterSettings, 911, 912 x:Uid attributes, 594, 596–597 XmlWriterTraceListener, 470, 471, 472, 473, 474, 1290 XNamespace, 945–946 Y x:Null, 744 yield break, 142, 145, 146 Xor(), 258, 260 yield return, 142, 144, 145–146, 273, 289 XPath, 917. See also System.Xml.XPath yield statement, 110, 111, 142–146 XPathDocument, 918 YieldDemo/GameMoves.cs, 145–146 XPathNavigator class, 918 YieldDemo/Program.cs, 142, 144, 146 “move” methods in, 918 Select methods in, 918 XPathNavigators, 471, 917–922 Z XPathNodeIterator, 918–919, 920, 921 XPS (XML Paper Specifi cation), 1089 zero impact installation, 15. See also xcopy installation XPS documents, 1089–1091 zero-parameter constructor, 76, 82 XpsDocument, 1090 Zip(), 276, 284–285

1474

bbindex.inddindex.indd 14741474 11/28/10/28/10 1:28:251:28:25 PMPM