Index
A CreditRisks tables, 854 DBTransaction, 853 Abstract stream members, 765 IDbTransaction interface, 853 Accelerate() method, 365, 376, 383 ProcessCreditRisk(), 855 Activator.CreateInstance() method, 607 Rollback(), 854 Active Data Objects (ADO). see ADO.NET save points, 854 Adaptive rendering, 1396 test, 857 Add() method, 362 data providers AddAsync() method, 1554–1555 application configuration files, 813 AddComplete() method, 705–706 benefit, 802 add_Exploded() method, 377 C# Console Application project, 812 Add() method, 698, 702, 1588 centric namespaces, 806 AddOne() method, 723 core objects, 802 AddPerson(), 401 DBMS, 803 AddWithThreads, 745 factory pattern (see Data provider ADO.NET factory model) AutoLot database creation IDbConnection parameter, 811 adding test records, 818 Microsoft, 804 Customers and Orders tables, 820 Microsoft SQL Server, 813 GetPetName() stored procedure, 819 System.Data.OracleClient.dll, 805 Inventory table creation, 815 third-party, 805 table relationships, in Visual Studio, 822 data readers connected layer of, 801 DbDataReader type, 835 AutoLotDataReader, 830 ExecuteReader(), 835 command objects, 834 multiple result sets, 836 connection objects, 830 Read() method, 835 ConnectionStringBuilder objects, 833 string/int, 835 data reader object, 829 DataSets, 800 Console UI–based front end DataTable, 403 AutoLotCUIClient, 846 disconnected layer, 802
ADO.NET (cont.) ListItems, 1495 stored procedure, 844 Lock() method, 1504 update logic, 841 machine.config file, 1520 System.Data namespaces Page_Load event handler, 1509 core members, 807 Profile property, 1522 database primitives, 806 profile data, 1521, 1524 IDataReader and IDataRecord interfaces, 810 Remove() method, 1503 IDbConnection interface, 807 RemoveAll() method, 1503 IDbDataParameter and IDataParameter Session data (see Session data) interfaces, 809 session variable, 1493 IDbTransaction interface, 808 simple web UI, 1492 System.Data.dll, 801 store session data, 1517 Application_Error() method, 1499 aspnet_state.exe, 1517 Application programming interface (API) InstallSqlState.sql, 1518 COM+, 1023 session state server, 1517 DCOM, 1022 web.config file, 1518 MSMQ, 1023 System.Web.Caching.Cache class, 1505 .NET remoting, 1024 System.Web.HttpApplication Type, 1500 web service standards, 1025 Unlock() method, 1504 XML web services, 1025 UserAddress data, 1524 AsDataView
1604 ■ Index
AutoLotDAL directory, 1404 GUI, 595 control declarations, 1410 LoadExternalModule() method, 596 data access logic, 1406 VbSnapIn, 593 directives, 1409 Windows Forms application, 593–594 script block, 1410 late binding templates, 1403–1404 CreateUsingLateBinding() method, 576 UI designing, 1406 Invoke Methods, 577 Unload event, 1429 System.Activator class, 574 Web.config file, 1431 TurboBoost() method, 576–577 web controls, 1399 VehicleDescriptionAttributeReader, 587 Web Forms 2.0, 1399 VehicleDescriptionAttribute Web Forms 3.5, 1400 ReaderLateBinding, 588 Web Forms 4.0, 1401 metadata Web Forms 4.5, 1401 Assembly token, 559 Web Forms 4.6, 1402 AssemblyRef #n token, 559 web site vs. web application, 1416 CarLibrary.EngineState enumeration, 556 Assembly-level attribute, 585 get_PetName() method, 558 Asynchronous method invocation ildasm.exe, 556 Add() method, 701 set_PetName() method, 558 AsyncCallback delegate, 703 string literal, 560 AsyncResult Class, 706 TypeRef, 559 AsyncState, 707 .NET attributes BeginInvoke() method, 700 CLS-compliant constructs, 579 EndInvoke() method, 700 constructor parameter, 581 IAsyncResult interface, 700 ildasm.exe, 580 Main() method, 701 notserialized token, 580 thread synchronization, 702 obsolete type, 581–582 Asynchronous programming predefined attributes, 578 AddWithThreads, 745 serializable token, 580 C# async, 741 shorthand attribute, 581 multiple awaits, 744 reflection naming conventions, 743 GetInterfaces() method, 565 void returning, 744 late binding, and custom attributes, 590 Attribute-based programming ListFields() method, 565 custom attribute ListInterfaces() method, 565 AssemblyInfo.cs, 586 Main() method implementation, 566 assembly-level attribute, 585, 587 parameter types, 568 AttributeTargets enumeration, 584 return types, 569 AttributeUsage, 585 System.Collections.Generic.List, 568 class definitions, 583 System.Object.GetType() class, 562 creation, 582 System.Reflection Namespace, 561 module-level attribute, 585 System.Type class, 561–562 named property, 583 System.Type.GetType() operator, 563 dynamic loading Type.GetMethods() method, 564 Assembly class, 569 typeof() operator, 563 Assembly.Load() method, 571–572 Autoincrementing ability, 865 AssemblyName type, 572 AutoLotDAL Version 4 ExternalAssemblyReflector class, 570 AutoLotTestDrive (see AutoLotTestDrive) LINQ, 573 BaseRepo addition extendable application Add() and AddRange() methods, 970 building process, 591 DbSet
1605 ■ index
AutoLotDAL Version 4 (cont.) Binary operators, 405 SaveChanges() helper methods, 968 Binding notification system Save()/SaveAsync() methods, 972 adding bindings and data, 1333 CreditRisk class, 963 observable models CreditRiskRepo, 974 nameof method, 1338 customer model class, 961 PropertyChanged event, 1336 CustomerRepo, 973–974 observable models (see Observable models) data annotations, 957 vehicle data, 1335 DataInitialize, 975 BuildTableRelationship() helper function, 899 DbContext addition, 964 BundleConfig, 1536 DropCreateDatabaseAlways class, 975 DropCreateDatabaseAlways
1606 ■ Index
output parameters, 113 assembly’s metadata, 521 positional args, 117 CarLibrary.dll, 521 reference parameters, 113 C# class library, 514–515 by value, 110 C# client application, 522 by variable, 111 CIL code, metadata, and assembly nullable types manifest, 514 assignment operator, 138 CLR header, 513 conditional operator, 147 code library, 510 data type, 144 code reuse, 510 equality operator, 146 cross-language inheritance, 525 GetBoolFromDatabase() method, 145 DerivedCars.cs, 516 if/else condition, 147 embedded resources, 514 null coalescing operator, 146 Exploring the CIL, 520 PointRef type, 138 GUI editor, 519 rectangle type, 139 GUI Properties editor, 520 SendAPersonByReference() method, 142 ildasm.exe, 518 SendAPersonByValue() method, 141 manifest data, 518 value types vs. reference types, 139, 143 self-describing, 511 structure unique types, 510 custom constructor, 135 versionable units, 511 default constructor, 135 visual basic console application, 523–524 definition, 133 Windows file header, 512 types, 133 XML configuration files, 511 variable creation, 135 Private assemblies C# dynamic keyword App.Config File, 529–530 dynamic data variable, 601 Configuration files, 527 limitations, 604 CSharpCarClient.exe, 528 practical uses, 605 MyLibraries subdirectory, 528 scope, 603 privatePath attribute, 529 C# extension methods, 442 probing process, 526 Common intermediate language (CIL), version number, 526 dynamic assemblies publisher policy assemblies C# Iteration Constructs disable policy, 548 foreach loop, 102 input parameters, 548 for Loop, 101
1607 ■ index
Class libraries (cont.) Emit() method, 690 strong name, 533 .field directive, 670 Visual Studio, 537 HelloWorld class type, 689 System.Configuration namespace, 550 member parameter, 672 ClearErrors() method, 867 mnemonic distinction, 654 Client-side scripting, 1395 ModuleBuilder Type, 688 CloneMe()method, 277 Module Set, 688 CloseConnection() method, 838 motivations, 652 Collection Classes .NET application, 652 arrays, 315 .NET class library, 669 generic collections (see Generic collections) opcodes, 653–654 nongeneric collections (see Nongeneric iteration constructs, 677 collections) local variable declaration, 675 System.Collections mapping parameters, 676 ArrayList, 318 .maxstack directive, 675 Classes, 319 member implementation, 673 key interfaces, 317 nonstatic method, 677 types, 317 Pop-Centric, 674 types, 316 Primary Stack-Centric, 674 ColorChanged() method, 1198 this reference, 677 Commit() method, 854 OpCodes.Call method, 690 Common Intermediate Language (CIL), 520 platform-specific instructions, 12 AppDomain.DefineDynamicAssembly() properties and methods, 671 method, 688 pushing and popping, 654 AppDomain.DefineDynamicModule() round-trip engineering method, 688 branching/looping constructs, 659 attributes, 653 C# console app., 656 benefits, 12 code labels, 659 Calc class, 10 common ilasm.exe, 661 CILCarClient.exe, 681 default constructor, 658 CILCars.dll, 678 HelloProgram.il file, 657, 662 C# keywords, 669 *.il file, 660 CreateMyAsm() method, 691 load-centric, 659 create MyAssembly.dll, 685 MessageBox.Show() method, 661 custom constructor, 690 mscorlib, 660 data type mapping, 669 peverify.exe, 662 define constructor, 671 SayHello() method, 691 DefineDefaultConstructor() method, 690 string member variable, 689 define field data, 670 System.AppDomain type, 686 directives and attributes, 653 System.Reflection.Emit.ILGenerator, 684 assembly declaration, 663 System.Reflection.Emit namespace, 683 CILTypes assembly, 664 TypeAttributes enumeration, 689 CILTypes.il file, 668 Common Language Runtime (CLR), 4 .class Directive, 666 definition, 20 common assembly-level directives, 664 key difference, 20 CTS structure, 667 mscoree.dll, 21 define class type, 665 Common Language Specification (CLS), 4 enum attribute, 667 compliance, 20 external assemblies, 663 programming constructs, 18 generic member, 668 rules, 19 implementing interface, 666 Common Type System (CTS), 4, 1024 MyBaseClass namespace, 665 class types, 15 .namespace directive, 664 delegate types, 17 type parameter, 668 enumeration types, 16
1608 ■ Index
interface types, 15 members, 84 intrinsic data types, 18 StringBuilder, 89 structure types, 16 string equality, 88 type members, 17 string interpolation, 90 Comparison operators, 410 verbatim string, 87 Component Object Model (COM), 3 System.TimeSpan, 81 ConfigureGrid() function, 1216 variable declaration, 75 Console.WriteLine() method, 395 C# programming language Contact() action method, 1542 anonymous types ControlTemplate class, 1316 definition, 424 Convert() method, 1214 equality, 427 ConvertBack() method, 1214 internal representation, 425 Cookie ToString() and GetHashCode() CookieStateApp, 1514–1516 implementation, 427 definition, 1514 custom type conversions HttpCookie.Expires property, 1515 class types, 412 HttpRequest.Cookies property, 1515–1516 custom conversion routines, 413 C# parameter modifiers, 110 explicit conversions, Square type, 416 C# programming implicit conversion routines, 417 BigInteger data type, 82 numerical conversions, 412 class hierarchy, 78 extension methods conditional operators, 105 definition, 419 data type conversion importing, 421 checked keyword, 94 IntelliSense of, 422 class Program, 91 interfaces, 422 implicit widening, 92 invoking of, 420 narrowing operation, 92 indexer definition, on interface types, 404 project-wide overflow/underflow data indexer methods, 399 checking, 96 multiple dimensions, 403 unchecked keyword, 96 overloading, 402 if/else statement, 104 string index values, 401 implicitly typed local variables operator overloading DeclareExplicitVars() method, 97 binary operators, 405 restrictions, 98 equality operators, 409 strongly typed data, 99 MiniVan class, 411 uses, 100 += and –+ operators, 408 intrinsic data types, 74, 77 unary operators, 408 iteration constructs (see C# Iteration Constructs) pointer types Main() method (see Main() method) field access, 435 numerical system type, 79 keywords, 430 parsing values, 81 pinning reference, 436 Relational/Equality Operators, 104 sizeof Keyword, 437 SimpleCSharpApp, 61 stackalloc Keyword, 435 switch statement, 105 unsafe (and safe) swap function, 434 System.Boolean data type, 80 unsafe keyword, 431 System.Char type, 80 Create() action method, 1552, 1596 System.Console Class (see System.Console Class) CreateDataReader() method, 922 System.DateTime, 81 CurrentNumberChanged() method, 1226 System.Environment Class (see System. Custom commands Environment Class) AddCarCommand System.String command class, 1373 basic string manipulation, 84 XAML, 1374 concatenation, 85 CommandManager escape characters, 86 creating CommandBase class, 1370 immutability, 88 updating ChangeColorCommand Class, 1370
1609 ■ index
Custom commands (cont.) development, 864 ICommand interface, 1367 properties, 863–864 RemoveCarCommand Data provider factory model command class, 1372
1610 ■ Index
Car class, 385 Disconnected functionality pseudocode, 386 configuring the data adapter, 892–893 C# events defining Initial Class Type, 892 Accelerate() method, 376 implementing GetAllInventory(), 894 add_Exploded() method, 377 implementing UpdateInventory(), 894 boilerplate code, 374 setting version number, 894 CarDelegate, 374 testing, 894–896 CarEngineHandler objects, 375 Disconnected layer. see DataSet CarEvents, 376 DisplayDefiningAssembly(), 420 cleaning up event invocation, 381 DisplayDelegateInfo() method, 362 custom event arguments creation, 382 DisplayMessage() method, 373 custom method, 385 DisplayTable() helper method, 849 event registration, 380 Dispose() method, 1549, 1558, 1588 Generic EventHandler
1611 ■ index
Encapsulation (cont.) entity names, 942 keyword FluentAPI, 944 constructor chaining, 161 Key attribute, 943 constructor flow, 163 Order class, 943 IntelliSense, 160 Orders and Inventory relationship, 944 Main() method, 160 StringLength attribute, 943 optional arguments, 165 SuppressMessage attributes, 943 SetDriverName(), 159 table attribute, 943 .NET properties, 184 AutoLotDAL Version 4 (see AutoLotDAL object initialization syntax Version 4) custom constructors, 197 AutoLot database, Inventory table, 932 initializing data, 198 building blocks objectInitializers, 196 DbContext class, 935–936 point objects, 196 DbSet
1612 ■ Index
table adapter supports methods, 930 G transaction test, 990 Entity Framework (EF), 802 Generic collections ExecuteNonQuery() method, 837 benefits, 327 ExecuteReader() method, 837 type parameters constraints, 350 generic class/structure, 328 F generic interfaces, 330 File I/O generic items, 327 BinaryReader object, 772 generic members, 330 BinaryWriter object, 772 operator constraints, 352 Directory.GetLogicalDrives() method, 756 where clause, 351 DirectoryInfo.CreateSubdirectory() GetAllInventory(), 894 method, 754–755 GetAllInventoryAsList() method, 850 DirectoryInfo Type, 752 GetChildren() method, 1313 DriveInfo.GetDrives() method, 757 GetCoffee() funtion, 338 File types, 762 GetCommandLineArgs() method, 66 FileAccess enumeration, 760 GetErrors method, 1359 file-centric members, 763 GetInventory() method, 1077, 1589 FileInfo.AppendText() method, 762 GetInventory(int id) method, 1589, 1592 FileInfo class, 758 GetOneAsync() method, 970, 1592 FileInfo.Create() method, 759 GetOne() method, 970 FileInfo.CreateText() method, 762 GetPerson(), 401 FileInfo.Open() method, 759, 761 GetValue() method, 1219 FileInfo.OpenText() method, 761 Global.asax.cs file, 1534 FileInfo types, 762 Global assembly cache (GAC), 532 FileMode enumeration, 760 Globally unique identifier (GUID), 534, 863 FileShare enumeration, 760 Graphical rendering, WPF FileStream object, 759 adding rectangles, ellipses, and FileSystemEventHandler, 774 lines, 1233–1236 FileSystemInfo type, 750 brushes and pens FileSystemInfo Base Class, 751 Brush-derived types, 1243 FileSystemWatcher type, 774 configuring in code, 1247–1248 GetFiles() method, 754 configuring pens, 1248 GetStringBuilder() method, 771 configuring using visual MemoryStream object, 773 studio, 1243, 1245, 1247 MyFolder directory, 774 drawings and geometries Stream class building DrawingBrush using CreateText() method, 768 geometries, 1259–1260 File.CreateText() method, 768 containing drawing types in FileStreams type, 765 DrawingImage, 1261–1262 StreamReader types, 770 Drawing class, 1258 StreamWriter type, 767, 770 Drawing-derived types, 1258–1259 StringReader type, 767 DrawingImage, 1259 TextReader class, 769 Drawing vs. Shape types, 1259 TextWriter class, 767 painting with DrawingBrush, 1260–1261 StringReader object, 770 graphical transformations (see Graphical StringWriter object, 770 transformations) System.IO namespace, 749 options, 1230 System.IO.NotifyFilters enumeration, 774 path Fill() method, 810 Geometry-derived classes, 1239–1240 FilterConfig, 1537 key members, 1239 FormatNumericalData() function, 72 mini-language, 1241–1242
1613 ■ index
Graphical rendering, WPF (cont.) I polylines and polygons, 1238 removing rectangles, ellipses, IAsyncResult interface, 700 and lines, 1236–1238 IDbCommand interface, 808 Shape base class, 1231–1233 IDbDataAdapter and IDataAdapter vector images (see Vector images) interfaces, 809 visual layer (see Visual layer) IgnoreRoute() method, 1543 Visual Studio transform editor (see Visual ImageMagick tool, 1263 Studio transform editor) Immediate-mode graphical systems, 1229 Graphical transformations Index() action method, 1543, 1549, 1555, 1595 adding a final
1614 ■ Index
InitializeComponent() method, 1178 null reference, 284 INotifyPropertyChanged interface, 1336 ThreeDCircle and Hexagon, 285 InsertAuto() method, 843, 850, 1079 types, 276–278 InsertCar() method, 1077 Visual Studio class diagram, 286 InsertNewElement() method, 1016 Visual Studio support, 289–290 Interfaces Interlocked.Exchange() method, 723 abstract base classes, 278 Internet Information Services (IIS) abstract members, 275 Default Web Site node, 1386 arrays, 288–289 Express, 1387 CloneMe() method, 285 virtual directories, 1387 cloning process Inventory() method, 1591 class named Point, 302–304 InventoryList ICloneable interface, 303 Clear method, 1343 MemberwiseClone() method, 304 NotificationCollectionChangedAction.Add PointDescription type, 304–307 value, 1342 custom interfaces NotificationCollectionChangedAction.Remove access modifier, 279 value, 1343 class/structure, 280 OnCollectionChanged method, 1341 compiler errors, 280 RemoveAt method, 1343 IPointy, 279 Invoke() method, 357–358, 361, 698 namespace, 279 IsEvenNumber() method, 389 read-only property, 280 explicit interface implementation Draw() method, 291, 293 J, K InterfaceNameClash, 291 JavaScript Object Notation (JSON), 1586, 1591 Octagon type, 292 Hexagon type, 283 IComparable interface L Car class, 307–308 Lambda expressions custom static property, 311–312 dissection, 391 definition, 307 lambdas and single statement member int data type, 309 implementations, 395 internal CarID, 308 multiple/zero parameters, 393 return values, 309 processing arguments, multiple statements, 392 sort order, 310–311 retrofitting CarEvents, 395 System.Array class, 308 SimpleLambdaExpressions, 388 IDbConnection, 275 LambdaExpressionSyntax() method, 392 IDraw3D interface, 286–287 Language Integrated Query (LINQ), 5 IEnumerable and IEnumerator LayoutTransform property, 1249 array type, 297 LinqOverDataTable() method, 923 Garage, 297–298 LINQ programming GetEnumerator() method, 298 DataRowExtensions.Field
1615 ■ index
LINQ programming model (cont.) Load() and Parse() methods, 1014 selection syntax, 459 SimpleInventory.xml file, 1011 sorting expression, 463 UTF-8 encoding, 1011 subsets of data, 460 XmlDocument and XmlElement classes, 1002 Core LINQ assemblies, 444 XML document creation, 1002 data, API uses, 443 ListInventory() method, 849 DataSet, 444 Load() method, 842 entities, 444 LogicalTreeHelper class, 1313 expressions, 444 LookUpColorsForMake() method, 1017 extension methods, 442 Lambda expressions, 441 local variables, 440 M object and collection initialization syntax, 440 MagicEightBallServiceLib., 1038 queries, 444 Main() method, 361–362, 366, 394, 699, 702, 717, and extension methods, 449 825, 833, 847 and local variables, 448 application error code, 64 contained subobjects, 455 command-line arguments, 65 deferred execution, 450 Program class, 62 enumerable type and anonymous refactored, 378 methods, 469 variations, 63 enumerable type and lambda MapPath() method, 1422 expressions, 467 MapRoute() method, 1543 enumerable type and raw delegates, 469 Metadata exchange (MEX), 1047 filtering data, OfType
1616 ■ Index
.NET metadata, 13 EditorFor() HTML helper, 1571 .NET Namespaces, 24 LabelFor helper, 1572 root namespace, 23 Delete view, 1574 Windows\Assembly\GAC, 26 Details view, 1570 Microsoft Transaction Server (MTS), 1023 Edit view, 1576 Model classes home page updation, 1581 DbSet
1617 ■ index
Model-View-ViewModel (MVVM) pattern (cont.) static Process.GetProcessById() method, 629 implementation System.AppDomain Class, 636 Button Command binding System.Diagnostics namespace, 626 statements, 1376 system.diagnostics.process, 627 data source, 1374 Nongeneric collections ObjectMaterialized event, 1380 issue of performance, 320 Module-level attributes, 585 issue of type safety, 323 Monitor.Enter() method, 722 Multitabled DataSet objects and data relationships building table relationships, 899 O displaying data, 896–897 Object generations, 479 navigating between related tables, 900 Object lifetime Button’s Click event handler, 900–901 application roots, 477 output when specifying customer ID, 901 CIL newobj instruction, 475 UI for customer order information, 900 classes, objects, and references, 473 preparation, 897 concurrent background garbage preparing data, 897–898 collection, 480 updating database tables, 899 concurrent garbage collection, 480 Multithreaded application disposable objects, 488 AutoResetEvent class, 715 finalizable and disposable types, 492 background threads, 716 finalizable objects foreground threads, 716–717 finalization process, 488 OS/CLR, 697 Overriding System.Object.Finalize(), 486 ParameterizedThreadStart delegate, 714 lazy object instantiation, 495 synchronization, 697 MakeACar() method, 475 attribute, 724 object generations, 479 C# lock keyword, 719 setting object references to null, 477 System.Threading.Interlocked Type, 723 System.GC Type System.Threading.Monitor class, 722 garbage collection, 482 synchronizing threads, 718 member selection, 481 System.Threading namespace, 696 Object-oriented programming (OOP), 175 ThreadStart Delegate, 712 Draw() method, 178 MyLocalVariables() method, 675 encapsulation, role of, 175 “has-a” relationship, 176 inheritance N controlling base class, 213 nameof method, 1338 Employee.cs and Employee.Core.cs NarrowingAttempt() method, 94 files, 212 .NET delegate, 697 Manager class, 212 .NET platform protected keyword, 215 context-agile and context-bound SalesPerson class, 212 types, 646 sealed class, 216 context-bound object, 647 inheritance, role of, 175 new application domains “is-a” relationship, 175 custom application domains, 643 polymorphic programmatically unloading abstract classes, 225 AppDomains, 644 abstract methods, 230 object’s context inspection, 647 Draw() method, 230 process’s module set, 632 GiveBonus(), 220 process’s thread set, 630 Main() method, 231 programmatically launch and terminate sealing virtual members, 225 process, 633 shadowing, 232 running processes, 628 shapes hierarchy, 228 Start() method, 634 virtual and abstract methods, 228
1618 ■ Index
virtual and override keywords, 221 P Visual Studio IDE, 223 polymorphism, 177 Parallel.ForEach() method, 728 ObjectResourcesApp, 1295 Parallel.For() method, 728 Object Serialization Parallel.Invoke() method, 738 customize serialization process, 796 Parallel LINQ Queries (PLINQ), 695 Formatter AsParallel() extension method, 739 BinaryFormatter type, 781, 783 cancellation, 740 Deserialize() method, 782 nonparallel version, 739 IFormatter type, 781 ParallelEnumerable Class, 738 IRemotingFormatter interfaces, 781 Parallel programming Person type, 783 CancellationTokenSource class, 733 Serialize() method, 782 data parallelism, 729 SoapFormatter type, 781, 786 System.Threading.Tasks type fidelity, 782 namespace, 728 XmlSerializer type, 781, 787 System.Threading.Tasks.Parallel class, 728 GetObjectData() method, 793 Task class, 732 ISerializable interface, 793–794 task parallelism, 735 ISerializable object, 793 Task Parallel Library (TPL), 727 MyStringData, 795 thread affinity, 731 object graph, 778 ParseFromStrings()method, 81 Object set, 790 PartialView() method, 1563–1564 private fields, 780 plain old CLR objects (POCOs), 1527 public fields, 780 Polymorphism, 177 public properties, 780 PopulateDocument() method, 1203 Serializable Types, 779 PostAsJsonAsync() extension method, 1597 SerializationInfo parameter, 793 PostInventory() method, 1593 StreamingContextStates enumeration, 794 Pre-WPF solutions, 1086 string data, 794 PrintDataSet() method, 872 System.Object, 790 PrintNumbers() method, 717–718 System.Runtime.Serialization namespace, 792 PrintTime() method, 725 UserPrefs class, 776 ProcessCreditRisk() method, 855 Observable models ProcessFiles() method, 731, 733 collections ProcessIntData() method, 740 dirty flag, 1345 PutInventory() method, 1592 IList
1619 ■ index
S catch statements, 268 compile-time errors, 267 SaveAs method, 1422 constructors, 251–252 Select() method, 883 containment/delegation, 251 Serviced component, 1023 data property, 258–260 Service-oriented architecture (SOA), 1027 debugging, 272–273 Session data definitions, 247 HttpSessionState class, 1513 filters, 271 session application GUI, 1512 HelpLink property, 257–258 Session_End(), 1510 inner exceptions, 269–270 Session_Start(), 1510 Main() method, 252–253 UserShoppingCart, 1511 .NET SetBinding() method, 1218 building blocks, 249 SetBindings() function, 1215 C code, 248 SetF1CommandBinding() method, 1178 E_FILENOTFOUND constant, 248 SetValue() method, 1219 System.Exception base class, 249–250 ShowDialog() method, 1149 WCF service, 249 ShowEnvironmentDetails()method, 67 Radio type, 251 ShowInstructions() method, 849 rethrowing exceptions, 268–269 SimpleBoxUnboxOperation() method, 320 StackTrace property, 257 Simple Object Access Protocol (SOAP), 786 system exceptions, 260 SoapFormatter type, 781 TargetSite property, 256 ref tokens, 786 try/catch block, 254–255, 270–271 System.Runtime.Serialization.Formatters. verbose error dump, 254 Soap.dll, 786 Subtract() methods, 362 SortCars() function, 1560 *.svc file, 1079 SqlCommandBuilder, 892–893 svcutil.exe, 1050 SquareNumber() method, 361 System.Collections.Generic Static method, 362 Classes, 332 static Thread.GetDomain() method, 696 Dictionary
1620 ■ Index
CLR thread pool, 726 INotifyDataErrorInfo interface core types, 708 additional features, 1358 current thread execution, 709 CheckMakeAndColor helper Name property, 710 method, 1358 Priority property, 711 code implementation, 1355 Thread Type errors collection, 1361 Instance-Level Members, 709 GetErrors method, 1359 Static Members, 708 InventoryPartial.cs class, 1361, 1363 TimerCallback delegate, 725 ModelT validation, 1357 System.Web Namespace, 1499 System.Collections and System. System.Windows.Markup, 1317 ComponentModel, 1361 System.Xml, 1317 ValidationError object, 1360 System.Xml.dll assembly, 1001 Label and TextBox, 1348 Validation controls, 1470 client-side form validation, 1470 T client-side JavaScript validation support, 1472 Task Parallel Library (TPL), 695, 697, 727 CompareValidator, 1473 Themes data annotations App_Theme folder, 1482 app testing, 1481 assigning, 1486 code, 1480 CssStyle property, 1482 EditItemTemplate, 1478–1479 page-by-page level, 1485 FormView control, 1478 property settings, 1482 InsertItemTemplate, 1479 selection, 1486 Inventory class, 1477 site-wide themes, 1485 Inventory.cs class, 1477 *.skin files, 1482 ItemTemplate, 1478 SkinID property, 1486 ModelErrorMessage control, 1477 style sheets, 1482 layout, 1471 ThreadPool.QueueUserWorkItem() properties, 1470 method, 726 RangeValidator, 1473 Thread.Sleep() method, 698 RegularExpressionValidator, 1472 Thread.Start() method, 716 RequiredFieldValidator, 1472 TimerCallback delegate, 725 ValidationGroups.aspx, 1476 ToArray() extension method, 461 ValidationSummary widget, 1474 ToolsSpellingHints_Click() method, 1175 ValidatorCtrls web site, 1471 TreesAndTemplatesApp, 1313 ValueAndReferenceTypes() method, 137 TryFindResource() method, 1311 Vector images TryUpdateModel, 1462 importing graphical data, 1265–1266 interacting with sign, 1266–1267 sample vector graphic file to XAML conversion U folder hierarchy, 1264 Update() methods, 810 printing, 1263–1264 UpdateCarPetName() method, 851 rendered image, 1265 UpdateInventory(), 894 using Inkscape, 1262–1263 Update() method, 1588 Verbatim string, 87 View() method, 1551 Virtual execution stack, 655 V Virtual member, 177 ValidateCurrentNumber method, 1225 Visual layer ValidateInput() method, 1422 DrawingVisual Class, 1269–1270 Validation rendering to custom layout manager, 1271–1273 CardId, 1349 responding to hit-test operations, 1273–1274 class, 1349 Visual Base class and derived Child ErrorTemplate property, 1351 classes, 1268 IDataErrorInfo interface, 1351 Visual Studio, 1388, 1390
1621 ■ index
Visual Studio transform editor C# code, 1440 applying transformations at design data-centric controls, 1446 time, 1256–1257 documentation, 1448 building initial layout, 1254–1255 dynamic controls transforming Canvas in code, 1257 btnGetTextData button, 1442 enumeration, 1441 lblTextBoxData, 1442 W text boxes, 1442–1443 WCFWindows Communication Foundation (WCF) WebControl base class, 1443 WcfTestClient.exe, 1030 web page, 1439 Web API project HTML description, 1438 AutoLotDAL project, 1585 Label control, 1440 AutoLotEntities variable remove, 1594