Index
■Special Characters AddServiceEndpoint( ) member, ServiceHost type, #define, preprocessor directive, 317–319 1032 #elif, preprocessor directive, 317–318 ADO.NET #else, preprocessor directive, 317–318 additional namespaces, 763–764 #endif, preprocessor directive, 317–318 vs. ADO classic, 759–760 #endregion, preprocessor directive, 317 application configuration files, 769–770 #if, preprocessor directive, 317–318 asynchronous data access, 792–793 #region, preprocessor directive, 317 autogenerated data components, 824–825 #undef, preprocessor directive, 317–319 autogenerating SQL commands, 816–817 % modulo operator, C#, 1097 autoincrementing, 797 & operator, pointer types, 312–313 binding DataTables to user interfaces, 804, 806 * operator, pointer types, 312–313 Command object, 781–782 ?? operator, 133 connected layer, 778 += operator, 610 connected vs. disconnected layer, 760 <%@Page%> directive attribute, ASP.NET, 846 connecting to database, Visual Studio 2005, 776 <%Import%> directive, ASP.NET, 846–847 connection objects, 779–780 => token, 1098 ConnectionStringBuilder object, 780–781 ? suffix, nullable types, 131 connectionStrings element, application configuration, 774–775 ■Numbers data access libraries, 1130 data adapter objects, 811–812 3D graphics graphical service, WPF, 1012 data providers, 760, 762 3D rendered animation, 970 data wizards, 822–825 100% code approach, 1048 DataColumn objects, 796, 798 ■ DataRelation objects, 817–820 A DataRow objects, 798–799, 801 A# programming language, 8 DataRow.RowState property, 799–800 Abort( ) method, Thread type, 460 DataSet class, 794–796 abstract classes, 164–165, 224 datasets in XML web services, 950 abstract members (interface), 221 DataTable objects, 800 abstract methods, 165–169 DataTableReader objects, 802 AcceptChanges( ) method DataView objects, 810 ADO.NET DataRow object, 798 DbDataReader object, 782–783 ADO.NET DataSet class, 795 definition, 759–760 AcceptsReturn property, Textbox, 705 deleting records, 787 access modifiers, 76–78 deleting rows, 806–807 Action property, [OperationContract] attribute, disconnected layer, 793 1029 example, data provider factory, 772–774 Active Template Library (ATL), description, 5 example database, 775 Add( ) method, 1064, 1089, 1148 filling a DataSet, 812 Add Reference dialog box, 356, 359–360, 1064 filters, 807–808 Add Service Reference option, Project menu, 1038 Firebird Interbase data provider, 763 AddAfterThis( ) method, 1148 IBM DB2 Universal Database data providers, AddBeforeThis( ) method, 1148 763 AddCacheDependency( ) method, ASP.NET HTTP IDbCommand interface, 766 Response, 860 IDbConnection interface, 765 AddFirst( ) method, 1148 IDbDataAdapter, IDataAdapter interface, 767 AddRange( ) method, ControlCollection, 702 IDbDataParameter, IDataParameter interface, AddRef( ) method, 181 766 addresses, 1026 IDbDataReader, IDataReader interface, binding, and contract (ABC) service, 1024 767–768 Windows Communication Foundation (WCF), IDbTransaction interface, 765 1026 inserting records, 786 1151 1152 ■INDEX
mapping DBMS names, 813 loading example code, 438 Microsoft data providers, 762–763 manipulation example code, 436–437 modifying tables, Command object, 784–786 overview, 425 multiple result sets, DbDataReader object, 784 relationship to processes, 435 multitabled DataSet objects, 817–820 thread relationship, 449 MySQL data providers, 763 unloading example code, 439–440 navigating between related tables, 820–821 AppendText( ) method, FileInfo class, System.IO, overview, 759 526, 528–529 parameterized command objects, 788 AppExit( ) method, 977 persisting datasets as XML, 803 application cache, ASP.NET, 901 PostgreSQL providers, 763 Application class, 973 provider factory model, 770–772 ApplicationExit event, 609 sort order, 807–808 ASP.NET HttpApplication members, 897 specifying DbParameter parameters, 788, 790 CompanyName property, 609 stored procedures using DbCommand, 790–791 DoEvents( ) method, 609 strongly typed datasets, 823–824 EnableVisualStyles( ) method, 609 System.Data, 764 ExecutablePath property, 609 third-party data providers, 763 Exit( ) method, 609 updating records, 787 Idle event, 609 updating rows, 809 Page Type properties, 856 updating using data adapter objects, 813–815 ProductName property, 609 using interfaces, 768–769 ProductVersion property, 609 view objects, 810 StartupPath property, 609 AdRotator example, ASP.NET, 874 System.Windows.Forms, 606 All Programs button, Windows OS, 963 ThreadExit event, 609 AllKeys property, ASP.NET HttpApplicationState application configuration files, ADO.NET, 769–770 members, 898 application development AllowDBNull property, ADO.NET DataColumn cordbg.exe debugger, 33, 40–41 object, 796 csc.exe compiler, 33–36 AnchorStyles enumeration values, 755 guide to .NET 2.0 Framework SDK, 33 animation installing .NET 2.0 Framework SDK, 33 in controls, 743 notepad.exe development editor, 33 WPF,1014 overview, 33 Animations graphical service, WPF, 1011 SharpDevelop, 33 anonymous methods TextPad development editor, 41 building query expressions using, 1120 Visual C# 2005 Express, 33 description, 282 application domain, garbage collection, 188 example, 283–284 application level state data, ASP.NET, 898–899 anonymous methods syntax, C#’s, 1090 Application property, WebService base class, 929 anonymous types, 1090, 1116 application root categories, 182–183 anonymous types containing, 1095–1096 application shutdown, ASP.NET, 900 declarations, 1095 Application_End( ) method, Global.asax event implementation of ToString( ) and handlers in ASP.NET, 896 GetHashCode( ), 1092–1093 Application_Error( ) method, Global.asax event internal representation of, 1091–1092 handlers in ASP.NET, 896 overview, 1090 Application_Start( ) method, Global.asax event semantics of equality for, 1093–1095 handlers in ASP.NET, 896 API, 1021 Application.Current property, 979 App_Browsers, ASP.NET 2.0 subdirectories, 851
arrays overview, 829 jagged, 129–130 page type inheritance chain, 855–856 multidimensional, 128 redirecting users, 861 as parameters and return values, 128 request/response cycle, HTTP, 829 using interface types in, 228 round-trips (postbacks), 836 in XML web services, 949 runat attribute, 847 as keyword script block, 847 determining interface support, 225 server-side event handling, 865 determining type, 172 simple web controls, 871 ascending operator, 1127 simple website example, 872–875, 877–883 ascending query operator, LINQ, 1122 single file code model, 842–843 *.asmx file, 1064 sorting and paging example, 878–879 ASP.NET stateless, description, 830 <%@Page%> directive, 846 submitting form data, 837–838 <%Import%> directive, 846–847 System.Web.UI.Control, 866–867, 869–870 adding and removing controls, 869–870 System.Web.UI.Page, 856 AdRotator example, 874 System.Web.UI.WebControls namespace, AutoEventWireUp attribute, 862–863 865–866 AutoPostBack property, 866 System.Web.UI.WebControls.WebControl, 870 browser statistics in HTTP Request processing, user interface in HTML, 834–835 858 using web controls, 865–866 at faster it Find categories of web controls, 871–872 validating form data, 837 classic ASP, 838, 840 validation controls, 883–885, client-side scripting, 836–837 version 1.x benefits, 840 code-behind, description, 842 version 2.0 code-behind page model, 847–849 benefits, 841
compilation cycle, 853 namespaces overview, 841 http://superindex.apress.com/ multifile pages, 854–855 web application, description, 830 single-file pages, 853–854 web development server, 832 debugging and tracing, 849–850 web page code model, 842–846 default.aspx content page example, 875–876 web server, description, 830 detailed content page example, 881–883 WebControl base class properties, 870–871 Document Object Model (DOM), 836 website directory structure, 851 Emitting HTML, 860 Windows XP Home Edition, 832 enumerating controls with Panel control, ASP.NET 2.0 namespaces 867–868 System.Web, 842 Error event, 863–864 System.Web.Caching, 842 form control declarations, 847 System.Web.Hosting, 842 GET and POST, 837–838 System.Web.Management, 842 HTML System.Web.Profile, 842 document structure, 833 System.Web.Security, 842 form development, 833 System.Web.SessionState, 842 overview, 832 System.Web.UI.x, 842 web controls, 871 ASP.NET 2.0 subdirectories HTTP App_Browsers, 851 overview, 829–830 App_Code, 851, 853 Request members, 857 App_Data, 851 Request processing, 857–859 App_GlobalResources, 851 Response members, 860 App_LocalResources, 851 Response processing, 859–861 App_Themes, 851 IIS virtual directories, 831 App_WebReferences, 851 incoming form data, 858–859 Bin, 851–852 inheritance chain, page type, 855–856 assemblies in-place editing example, 879–880 Add Reference dialog box, 356, 359–360 Internet Information Server (IIS), 830 app.config file, 368 inventory content page example, 877–878 binary code reuse, 347 IsPostBack property in HTTP Request CIL code, 351, 358 processing, 859 client application example, 359–360 life cycle of a web page, 861–863, 865 CLR file header, 350–351 master pages example, 872–873 code base config file element, 385, 387 menu control example, 873 code library, 347 1154 ■INDEX
compared with legacy executables, 347 assembly metadata, const values, 81 consuming shared assemblies, 376–377 AssemblyBuilder, System.Reflection.Emit cross-language inheritance, 362 namespace, 505 definition, 347 AssemblyCompanyAttribute attribute, 415 delayed digital signing, 375–376 AssemblyCopyrightAttribute attribute, 415 dependentAssembly config file element, AssemblyCultureAttribute attribute, 415 381–382 AssemblyDescriptionAttribute attribute, 415 download cache, 352 AssemblyInfo.cs file, 415 dynamic redirection to a specific version, AssemblyKeyFileAttribute attribute, 416 381–382 AssemblyLoad event, System.AppDomain, 436 embedded resources, 352 AssemblyName class, System.Reflection example of version updating, 379–382 namespace, 396 explicit load request, 366, 368 assembly/namespace/type distinction, 22 flow of CLR external reference resolution, 388 AssemblyOperatingSystemAttribute attribute, 416 global assembly cache (GAC), 25, 348 AssemblyProcessorAttribute attribute, 416 ildasm exploration of manifest, 357 AssemblyProductAttribute attribute, 416 implicit load request, 366, 368 AssemblyRef, 394 internal format, 349 AssemblyResolve event, System.AppDomain, 436 language integration, 360, 362, 364–365 AssemblyTrademarkAttribute attribute, 416 manifest, 11, 348, 351, 357 AssemblyVersionAttribute attribute, 416 metadata description, 10 association relationship, 1137 module-level manifest, 364 AsyncCallback delegate, multithreaded modules, 11, 352 applications, 456–457 multifile, 352, 362–365 asynchronous data access, ADO.NET, 792–793 .NET Framework Configuration utility, 369–370, asynchronous delegate call, 260–261 382 asynchronous I/O, 542–543 netmodule file extension, 352, 362–364 asynchronous multithreading using delegates, overview, 10, 347 260–261 private, 365–366, 368 AsyncPattern property, [OperationContract] probing process, 366, 368 attribute, 1029 publisher policy assemblies, 384–385 AsyncResult class, multithreaded applications, referencing external, 25 457–458 and resource files, 693 ATL (Active Template Library), description, 5 satellite assemblies, 352 attached properties, 976, 995, 1006 self-describing, 348 attribute-based programming shared assemblies, 371 assembly, module level attributes, 415 configuration, 378–379 AttributeUsage attribute, 414 and the GAC, 374 C# attribute notation, 411 single-file, 352 CLSCompliant attribute, 408–409 example, 354–356 COM vs. .NET attributes, 408 vs. multifile, 11 constructor parameters, 411 strong names, 348, 357, 371, 373–374 custom attributes, 412 assigning using Visual Studio 2005, 374 description, 408 code example, 373 DllImport attribute, 409 type metadata, 348, 351, 358 early binding, 416–417 updating applications using shared assemblies, example of custom attributes, 413 378–379 extensibility version number, 348 and dynamic loading, 418 Visual Studio 2005 configuration, 368 and late binding, 418 Win32 file header, 349 and reflection, 418 Windows Presentation Foundation (WPF) using attributes, 418–424 Application class, 973 late binding, 417–418 overview, 972–973 multiple attributes, 410–411 Window class, 974–976 NonSerialized attribute, 409 Assembly class, System.Reflection namespace, Obsolete attribute, 408–409, 411 396, 402–406 overview, 391 assembly directive, common intermediate restricting attributes, 414 language (CIL), 488 Serializable attribute, 409 assembly manifest serializing example, 409–410 initial example, 15 summary of attribute key points, 412 overview, 15 Visual Basic snap-in example, 420–421 ■INDEX 1155
WebMethod attribute, 409 binary code reuse, 347 Windows forms example, 421–422 binary opcodes, 479 attributes, 415–416, 479 BinaryFormatter Attributes property, FileSystemInfo class, 519, 521 deserialization, 551 AttributeUsage attribute, 414 serialization, 548, 550–551 authentication element, Web.config, ASP.NET, 912 BinaryReader class, 517, 538–539 authorization element, Web.config, ASP.NET, 912 BinaryWriter class, 538 Authorization member, ServiceHost type, 1033 binding DataTables to user interfaces, ADO.NET, AutoCheck property, Button, 711 804, 806 AutoEventWireUp attribute, ASP.NET, 862–863 binding element, WSDL document elements, 939 AutoGen property, [Column] attribute, 1133 bindings, 1024–1026 autogenerated, 984 blue screen of death, 971 autogenerating SQL commands, ADO.NET, Boolean member variable, 985 816–817 Boolean statement, 1115 AutoIncrement- property, ADO.NET DataColumn boxing and unboxing, 104–106 object, 796 CIL code, 322 autoincrementing, ADO.NET, 797 generics issues, 321–322 AutoPostBack property, ASP.NET web controls, InvalidCastException, 322 866 .NET 1.1 solution, 323–324 AutoResetEvent type, 1060 .NET 2.0 solution, 325 BrowsableAttribute, System.ComponentModel, at faster it Find ■B 746 BackColor property, 1008 Browser Applications (XBAPs), XAML, 1017–1018 BAML (Binary Application Markup Language), Browser controls, 736–737 986–987 browser statistics in HTTP Request processing, *.baml files, 986 ASP.NET, 858 base keyword in class creation, 156–157 Brush type, 1005 http://superindex.apress.com/ baseAddress key, 1031 brushes, 1012 BaseAddresses member, ServiceHost type, 1033 Brushes graphical service, WPF, 1010 BaseDirectory( ), System.AppDomain, 436 btnClickMe button, 1008–1009 BasePriority, ProcessThread type, 432 btnExitApp_Clicked( ) method, 984 BaseStream property, BinaryReader class, 538 bubbling events, 1008 BaseStream property, BinaryWriter class, 538 BufferedStream type, input/output, System.IO, basic string operations, 123–124 517 BasicHttpBinding binding class, WCF, 1024 bugs, description, 197 basicHttpBinding class, 1037 built-in style engine, 971 BeginCatchBlock( ) method, business process, 1047, 1053 System.Reflection.Emit.ILGenerator, 506 Button control BeginClose( ) member, ServiceHost type, 1033 AutoCheck property, 711 BeginExceptionBlock( ) method, CheckAlign property, 711 System.Reflection.Emit.ILGenerator, 506 Checked property, 711 BeginFinallyBlock( ) method, CheckState property, 711 System.Reflection.Emit.ILGenerator, 506 FlatStyle property, 709, 711 BeginInvoke( ) method, 453–458, 944 Image property, 709 BeginLabel( ) method, ImageAlign property, 709 System.Reflection.Emit.ILGenerator, 506 TextAlign property, 709 BeginLocal( ) method, ThreeState property, 711 System.Reflection.Emit.ILGenerator, 506 Button type, 981, 1072 BeginOpen( ) member, ServiceHost type, 1033
command-line compiler, 1075–1076 CheckAlign property, Button, 711 extension methods, 1080–1085 CheckBox control, 702, 711, 713 implicitly typed local variables, 1076–1079 element, 982 CharacterCasing property, Textbox, 705 CodeActivity, WF, 1051 ■INDEX 1157
code-behind, description, ASP.NET, 842 method parameters, 495 code-behind files, 988–989 methods, 494–495 code-behind page model, ASP.NET, 847–849 mnemonics, 479 CodePage, ASP.NET <%@Page%> directive modifying CIL code, 481–485 attribute, 846 module directive, 488 collections mresources directive, 489 ICollection interface, 248 namespace directive, 489 IDictionary interface, 248 new keyword, 181 IDictionaryEnumerator interface, 249 opcodes, 479, 495 IList interface, 249 overview, 11, 477 initialization, 1089 peverify.exe tool, 487 overview, 221 as programming language, 477 CollectionsUtil, System.Collections.Specialized, properties, 494–495 253 pushing and popping from the stack, 480 colon operator, 111 round-trip engineering, 481–485 color values, GDI+, 663 saving code using ildasm.exe, 481–483 ColorDialog class, GDI+, 664–665 stack-based programming, 480 [Column] attribute, 1133–1134 structures, 491 ColumnAttribute type, 1131, 1133 subsystem directive, 489
Combine( ) method, data types, 1039 http://superindex.apress.com/ System.MulticastDelegate/System file header in assemblies, 350–351 Delegate, 263 hosts ComboBox control, 716–717 CLR versions, 446 Command object, ADO.NET, 761, 781–782 dotnetfx.exe, 444 command-line compiler, 1075–1076 hosting the CLR, 447 CommandTimeout, DbCommand, ADO.NET, 782 multiple .NET Framework versions, 445 common intermediate language (CIL) .NET assembly activation under Windows advantages of learning CIL, 477–478 XP, 444–445 assembly directive, 488 overview, 425 attributes, 479 requiredRuntime config specification, 446 benefits, 13 side-by-side execution, 445 binary opcodes, 479 specific CLR version specification, 446 C# vs. VB.NET, 11–12 mscoree.dll, 20 class directive, 489–490 mscorlib.dll, 21 code explained, 482–483 overview, 20 code labels, 483–484 Common Language Specification (CLS), 19–20 compiler flags, 485 Common Type System (CTS) compiling code, 485–486 adornments, 18 compiling to specific platforms, 14 class types, 16 complete example program, 500–504 delegate types, 17 current object parameter, 499 enumeration types, 17 defining the current assembly, 488 interface types, 17 directives, 478 intrinsic types, 18 enums, 491 overview, 15 externally referenced assemblies, 488 structure types, 16 field directive, 493 type members, 18 ilasm.exe compiler, 477 Community Technology Preview (CTP), 959 interfaces, 490 CompanyName property, Application class, 609 iteration, 499 comparable objects (IComparable), 242–244 just-in-time (JIT) compiler, 14 CompareExchange( ) method, Interlocked type, locals directive, 498 multithreaded applications, 472 mapping C# types to CIL types, 492–493 CompareValidator control, ASP.NET, 884, 887 mapping parameters to variables, 498 maxstack directive, 497 1158 ■INDEX
compilation cycle, ASP.NET 2.0 controls multifile pages, 854–855 adding using Visual Studio 2005, 702–703 overview, ASP.NET 2.0, 853 animation, 743 single-file pages, 853–854 basic controls, 703–704 compilation element, Web.config, ASP.NET, 913 Button, 709–710
Copy( ) method, ADO.NET DataSet class, 795 Custom Control Library (WPF) project template, CopyTo( ) method, FileInfo class, System.IO, 526 1002 cordbg.exe debugger, 40 custom controls, 737–743 Count, ControlCollection, 702 custom dialog boxes, 750–752 Count property, ASP.NET HttpApplicationState custom events, 741 members, 898 custom exceptions, structured exception covariance, delegates, 275–276 handling, 209–210 create, remove, update, and delete (CRUD), 1129 custom namespaces, 133–134 Create( ) method custom parameters, 1060 DirectoryInfo class, 519, 522–523 custom properties, 741–744 FileInfo class, System.IO, 526 custom type conversion CreateDomain( ) method, System.AppDomain, CIL special names, 306 435, 437 conversions among related class types, 301–302 CreateFunctionalXmlDoc( ) method, 1144 explicit keyword, 302–304 CreateInstance( ) method, System.AppDomain, implicit conversions, 301 436 implicit keyword, 302–306 CreateObjRef( ) method, numerical conversions, 301 System.MarshalByRefObject, 572 custom types in XML web services, 948 CreateText( ) method, FileInfo class, System.IO, custom view states, state management in 526, 528–529 ASP.NET, 893–894 CreateWorkflow( ) method, 1060 CustomAttributeBuilder, System.Reflection.Emit at faster it Find CreationTime property, FileSystemInfo class, 519 namespace, 505 Credentials member, ServiceHost type, 1033 customErrors element, Web.config, ASP.NET, CRUD (create, remove, update, and delete), 1129 913–915 *.cs file, 1037, 1057 CustomValidator control, ASP.NET, 884 csc.exe compiler, 33
@ symbol (response files), 39 ■D http://superindex.apress.com/ command-line flags, 36 data caching, ASP.NET, 901, 903–905 compile parameters, 36 data contract, 1039 configuration, 34–35 data manipulation, 1108 /debug command-line flag, 41 Data property, System.Exception, 200, 206–207 default response file (csc.rsp), 40 data providers, ADO.NET, 760–761 a first C# application, 36 data type declaration, 1079 GAC utility, gacutil.exe, 35 DataAdapter object, ADO.NET data providers, 761 mscorlib.dll, 37 /database option, sqlmetal.exe command, 1134 multiple external assemblies, 39 Database property, DbConnection, ADO.NET, 779 multiple source files, 38–39 DataBind( ) method, System.Web.UI.Control in /noconfig command-line flag, 40 ASP.NET, 867 /nostdlib command-line flag, 37 data-binding engine, 971 /out command-line flag, 36 DataColumn, ADO.NET, 796–797 Path, setting, 34–35 DataColumn objects, ADO.NET, 764, 796, 798 reasons for using, 34 DataContext type, 1130–1133, 1137 /reference command-line flag, 37 [DataContract] attribute, 1039 referencing external assemblies, using DataReader object, ADO.NET data providers, 761 keyword, 37 DataRelation objects, ADO.NET, 764, 817–820 response files, 39 DataRow objects, ADO.NET, 764, 798–799, 801 /target command-line flag, 36 DataRow.RowState property, ADO.NET, 799–800 wildcard character, 38 DataRowState enumeration values, ADO.NET, 799 *.csproj files, 983, 989 DataSet, System.Data, ADO.NET, 764 CTP. See LINQ Community Technology Preview DataSet class, ADO.NET, 794–796 CTS. See Common Type System DataSetName property, ADO.NET DataSet class, Current property, Application type, 973 795 CurrentContext property, Thread type, 460 Datasource property, DbConnection, ADO.NET, CurrentLeaseTime, ILease interface remoting, 593 779 CurrentPriority, ProcessThread type, 432 DataTable, System.Data, ADO.NET, 764 CurrentState, ILease interface remoting, 593 DataTable object, ADO.NET, 800 CurrentThread property, Thread type, 460–461 DataTable objects, ADO.NET, 800 custom behaviors, 1003 DataTableReader objects, ADO.NET, 764, 802 custom control design time appearance, 746 DataType property, ADO.NET DataColumn object, custom control hosts, 744–745 796 DataView objects, ADO.NET, 765, 810 1160 ■INDEX
DateTimePicker control, 721 covariance, 275–276 DbCommand, ADO.NET delegate keyword, 259 Cancel( ), 782 description, 259 CommandTimeout, 782 example, 266–268 Connection, 782 information in, 259 ExecuteNonQuery( ), 782 multicasting, 262, 268–270 ExecuteReader( ), 782 and multithreaded applications, 451–453 ExecuteScalar( ), 782 NullReferenceException, 267–268 ExecuteXmlReader( ), 782 overview, 255 Parameters, 782 as parameters, 271–273, 275 DbConnection, ADO.NET simple example, 263–264 BeginTransaction( ) method, 779 synchronous call, 260 ChangeDatabase( ) method, 779 types, 17 ConnectionTimeout( ) method, 779 delegation, description, 160 Database property, 779 Delete( ) method Datasource property, 779 ADO.NET DataRow object, 799 GetSchema( ) method, 779 DirectoryInfo class, 519 State property, 779 FileInfo class, System.IO, 526 DbDataAdapter, 811 DeleteCommand property in updating, ADO.NET, DbDataReader object, ADO.NET, 782–783 815 DbParameter, ADO.NET, 789 deleting DBType property, [Column] attribute, 1133 records, ADO.NET, 787 DbType property, ADO.NET DbParameter, 789 rows, ADO.NET, 806–807 debugging and tracing, ASP.NET, 849–850 dependent properties, 976 DecimalPlaces property, NumericUpDown, 728 dependent property syntax, 1005 decisions and relational/equality operators, 94–96 deployment, .NET runtime, 29 Decrement( ) method, Interlocked type, derived class, description, 145 multithreaded applications, 472 descending operator, 1127 deep copy, cloneable objects (ICloneable), 242 descending query operator, LINQ, 1122 default constructor, 70–71 DescriptionAttribute, System.ComponentModel, default input button, 719 746 default keyword, generics, 333 Designer.cs file, 702–703 default option, 964 *.Designer.cs file, 1056 default.aspx content page example, ASP.NET, desktop markup, 970 875–876 detailed content page example, ASP.NET, 881–883 DefaultEvent attribute, controls, 748 developing software DefaultEventAttribute, System.ComponentModel, as a C++/MFC programmer, 4 746 as a COM Programmer, 5 DefaultProperty attribute, controls, 748 as a C/Win32 programmer, 3 DefaultPropertyAttribute, as a Java/J2EE Programmer, 4 System.ComponentModel, 746 as a Visual Basic 6.0 programmer, 4 DefaultValue attribute, controls, 747 as a Windows DNA Programmer, 5 DefaultValue property, ADO.NET DataColumn devenv /setup /resetuserdata /resetsettings object, 796 command, 967 DefaultValueAttribute, System.ComponentModel, device coordinates, GDI+ coordinate systems, 746 659–660 DefaultWsdlHelpGenerator.aspx, 925–926 dialog boxes, custom, 750–752 DefineEnum( ) method, ModuleBuilder type, 510 Dictionary object, 1061 DefineResource( ) method, ModuleBuilder type, Dictionary
GetDirectories( ) method, 519 ■E GetFiles( ) method, 520–522 ECMA standardization, .NET Framework, 29 MoveTo( ) method, 520 edit processing members, ADO.NET DataRow Parent property, 520 object, 799 Root property, 520 Eiffel .NET programming language, 8 DirectoryName, FileInfo class, System.IO, 526 Emit( ) method, DirectX, 970–971 System.Reflection.Emit.ILGenerator, 506 dirty windows, Paint event, GDI+, 656 EmitCall( ) method, DISCO web service UDDI directory, 921 System.Reflection.Emit.ILGenerator, 506 disconnected layer, ADO.NET, 793 Emitting HTML, ASP.NET, 860 DispatchMessage( ) method, remoting EmitWriteLine( ) method, ChannelServices, 579 System.Reflection.Emit.ILGenerator, 506 DisplayDefiningAssembly( ) method, 1080–1081, EnableThemeing property, 1083 System.Web.UI.Control in ASP.NET, 867 DisplayResult( ) method, 1064 EnableTheming, ASP.NET <%@Page%> directive disposable objects, 191–193 attribute, 846 disposing Graphics objects, GDI+, 658–659 EnableViewState, ASP.NET <%@Page%> directive distributed transactions, 1022 attribute, 846 *.dll assemblies, 1070 EnableVisualStyles( ) method, Application class, DLL hell, 5 609 idi atrat faster it Find DllImport attribute, 409 encapsulation DNA (Windows Distributed interNet Applications accessor (get) and mutator (set) methods, Architecture) deficiencies, 5 147–148 /doc compiler flag, 176 black box programming, 148 doc variable, 1147 class properties, 149–153 Dock property, 755–756, 1006 description, 145
DockPanel control, WPF Panel, 994 get http://superindex.apress.com/ DockPanel panels, 1000–1001 set keywords for class properties, 149–150 DockPanel.Dock value, 1000 set properties vs. accessor and mutator DockStyles enumeration values, 755 methods, 150–152 Document Object Model (DOM), ASP.NET, 836 public fields and data validation, 148 documentation of source code with XML, 174–177 read-only class properties, 153 DoEvents( ) method, Application class, 609 static class properties, 153–154 DOM (Document Object Model), ASP.NET, 836 visibility of get/set statements, 153 DomainUnload event, System.AppDomain, 436, write-only class properties, 153 439–440 encoding, 1025 DomainUpDown, 728 End( ) method, ASP.NET HTTP Response, 860 dot operator and references, 180 EndClose( ) member, ServiceHost type, 1033 dotnetfx3setup.exe setup program, 960 EndExceptionBlock( ) method, dotnetfx.exe, .NET runtime deployment, 29 System.Reflection.Emit.ILGenerator, 506 DoubleAnimation type, 1015 EndInvoke( ) method, 453–454, 944 Download button, 962 EndOpen( ) member, ServiceHost type, 1033 download cache, 352
enumerable types (IEnumerable and explicit cast, 170–171, 224–225 IEnumerator), 235–237 explicit interface implementation, 229–231 enumerating controls with Panel control, ASP.NET, explicit keyword, custom type conversion, 867–868 302–304 enumeration types, 17 Expression property, ADO.NET DataColumn enums, 107–110, 491 object, 797 equality operators, C#, 1094 expression trees, 1105 Equals( ) method, 111, 1092 Extensible Application Markup Language (XAML). equals query operator, LINQ, 1122 See XAML Error event, ASP.NET, 863–864 extension methods, 1108, 1113–1114 error processing members, ADO.NET DataRow building and using extension libraries, object, 798 1084–1085 ErrorBlinkStyle properties, controls, 730 defining, 1080–1081 ErrorMessage dictionary, 1061 importing types that define, 1083 ErrorMessage property, 1062 invoking from instance level, 1081–1082 ErrorProviders, 729–731 invoking statically, 1082–1083 escape characters, summary, 124 overview, 1080 event handling in ToolStrips, Visual Studio 2005, Extension property, FileSystemInfo class, 519 643 externally referenced assemblies in common event handling syntax, 1096 intermediate language (CIL), 488 event interface, 256–257, 259 event trigger, 1015 ■F EventBuilder, System.Reflection.Emit namespace, FaultHandlerActivity, WF, 1051 505 field directive, common intermediate language EventDrivenActivity, WF, 1051 (CIL), 493 EventHandlingScopeActivity, WF, 1051 FieldBuilder, System.Reflection.Emit namespace, EventInfo class, System.Reflection namespace, 505 396 FieldInfo class, System.Reflection namespace, 396 events File class, System.IO, 518–519, 529, 531 adding to custom controls, 741 FileAttributes enum, FileSystemInfo class, 521 compared with delegates, 277 FileInfo class, System.IO, 525 event keyword, 277 AppendText( ) method, 526, 528–529 example, 277 CopyTo( ) method, 526 explanation, 278–279 Create( ) method, 526 listening to incoming events, 279–280 CreateText( ) method, 526, 528–529 Microsoft recommended pattern, 281–282 Delete( ) method, 526 overview, 255 Directory, 526 registration, 279–281 Length, 526
fixed keyword, 315 overriding finalize( ), 189–190 FlatStyle property, Button, 709, 711 overview, 179 FlowLayoutPanel, controls, 756–757 PInvoke, 189 Flush( ) method reachable objects, 180 ASP.NET HTTP Response, 860 Release( ) not required, 181 BinaryWriter class, 538 SuppressFinalize( ) method, 185 Stream class, System.IO, 532 System.GC, 185 TextWriter, System.IO, 534 threads suspended, 182 FontDialog class, GDI+, 671–672 timing of, 181 fonts, GDI+, 665–670 unmanaged resources, 185, 189–190, 193 Foo( ) method, System.Int32 type, 1081, 1083 WaitForPendingFinalizers( ) method, 185–186 for loop, 92 when heap objects are removed, 180, 182 forcing garbage collection, 187 *.g.cs file, 988, 1004 foreach loop, 93, 1077, 1111 GDI+ Form, System.Windows.Forms, 606 color values, 663 Form class ColorDialog class, 664–665 events, 618–619 coordinate systems, 659–660 example program, 619–620 core namespaces, 649, 650 life cycle, 619 custom point of origin, 662 methods, 618 disposing graphics objects, 658–659 properties, 618 FontDialog class, 671–672 at faster it Find form control declarations, ASP.NET, 847 fonts, 665–670 form data, access in ASP.NET, 858–859 hit testing nonrectangular images, 688–690 form inheritance, 752–754 hit testing rendered images, 687–688 Form object inheritance chain, 612 methods in FontFamily, 666 Format( ) method, System.Enum, 109 overview, 649
forms, 605 PageUnit property, custom unit of measure, http://superindex.apress.com/ forms controls, 699 661–662 Forth .NET programming language, 8 Pen properties, 673 Fortran .NET programming language, 8 Pens collection, 673 from, in query operator, LINQ, 1122 PictureBox type, 684–686 from operator, 1123 System.Drawing, 650 full trust, 1017 System.Drawing namespace, 650 FullName property, FileSystemInfo class, 519 System.Drawing.Brush, 677 fully qualified type names, 134–136 HatchBrush, 678–679 Func< > delegates, 1120 LinearGradientBrush, 681 Func< > type, System.Query namespace, 1118 TextureBrush, 679–680 functional languages, 959, 1105 System.Drawing.Drawing2D, 650, 672–676 /functions option, sqlmetal.exe command, 1134 System.Drawing.Font, 665 FxCop development tool, 62 System.Drawing.Graphics class, 653 System.Drawing.Image, 682–684 ■G System.Drawing.Imaging, 650 GAC. See Global Assembly Cache System.Drawing.Printing, 650 GAC utility, 35, 1023 System.Drawing.Text, 650 garbage collection, 72 unit of measure, 660 AddMemoryPressure( ) method, 185 generic collections, using LINQ to query AddRef( ) not required, 181 anonymous types, 1116 application domain, 188 defining LINQ queries, 1115 application roots, 182 overview, 1114–1115 code example, 185–187 generic method Collect( ) method, 185–187 example code, 329–332 CollectionCount( ) method, 185 type parameter omission, 330–332 compared with C++, 181 generics finalizable objects, 188 base classes, 339–340 finalization details, 191 boxing and unboxing issues, 321–325 forcing, 186–187 constraining type parameters using where, GetGeneration( ) method, 185 335–338 GetTotalMemory( ) method, 185 custom generic collections, 334–335 MaxGeneration property, 185 default keyword, 333 object generations, 184 delegates, 341–343 object graph use, 182–183 generic methods, 329–332 1164 ■INDEX
interfaces, 340–341 get/set lack of operator constraints, 338–339 accessor and mutator methods comparison, nested delegates, 343 150–152 overview, 321 visibility of statements, 153 System.Collections.Generic.List<>, 325–326 GetSubsets( ) method, 1125 uses of, 321–325 GetTable( ) method, DataContext type, 1131 Geometries graphical service, WPF, 1012 GetType( ) method Gephardt, Sean, 45 System.Object class, 111, 397 GET and POST, ASP.NET, 837–838 System.Type class, 397 GetAndValidateUserName( ) method, 1058, 1062 GetUnderlyingType( ) method, System.Enum, 109 GetAssemblies( ) method, System.AppDomain, GetUrlsForObject( ) method, remoting 436 ChannelServices, 579 GetChanges( ) method, ADO.NET DataSet class, GetValues( ) method, System.Enum, 109 795 Global Assembly Cache (GAC) GetChannel( ) method, remoting and assemblies, 348 ChannelServices, 579 internal composition, 382–384 GetChildRelations( ) method, ADO.NET DataSet overview, 25 class, 795 Global.asax event handlers in ASP.NET, 896 GetConstructors( ) method, System.Type class, Global.asax file, ASP.NET, 894–896 396 globalization element, Web.config, ASP.NET, 913 GetCurrentProcess( ) method, Globally Unique Identifier (GUID), 240–242 System.Diagnostics.Process, 429 graphics object, 1011 GetCurrentThreadId( ) method, Graphics object with no Paint event, GDI+, 657 System.AppDomain, 435 GraphicsPath class, methods, GDI+, 689 GetDataToAdd( ) method, 1063 Grid control, WPF Panel, 994 GetDataToAddActivity, 1063 Grid panels, 999–1000 GetDirectories( ) method, DirectoryInfo class, 519 Grid.Column property, 1000 GetDomain( ) and GetDomainD( ) methods,
historical overview of programming IDbDataReader, IDataReader interface, ADO.NET, C++/MFC, 4 767–768 Component Object Model (COM), 5 IDbTransaction interface, ADO.NET, 765 C/Win32, 3 IdealProcessor, ProcessThread type, 432 Java/J2EE, 4 identity, private assemblies, 365 Visual Basic 6.0, 4 IDictionary System.Collections interface, 247 Windows DNA, 5 IDictionaryEnumerator System.Collections hit testing interface, 247 nonrectangular images, 688, 690 IDisposable interface, unmanaged resources, rendered images, 687–688 191–193 HTML Idle event, Application class, 609 and ASP.NET, overview, 832 IEnumerable and IEnumerator (enumerable document structure, 833 types), 235–237 form development, 833 IEnumerable interface, 1116 HTTP binding types, 1039 IEnumerable System.Collections interface, 247 HTTP channel, remoting, 568 IEnumerable
HybridDictionary, System.Collections.Specialized, IHashCodePRovider System.Collections interface, http://superindex.apress.com/ 253 247 IIS ■I default web site, 830 i parameter, 1099 description, 830 IasyncResult interface, 260–261 virtual directories, 831 ICarOrder service contract, 1040–1041 IIS deployment, XML web service, 925 ICloneable (cloneable objects), 238–242 IIS virtual directory, 1030 ICollection System.Collections interface, 247–248 IKeyComparer System.Collections interface, 247 ICollection System.IDictionaryEnumerator IL (intermediate language), 10 interface, 249 ilasm.exe compiler, common intermediate ICollection System.Idictionaryinterface, 248 language (CIL), 477 ICollection System.IList interface, 249 ildasm exploration of manifest, 357 ICollection
Include attribute ,
Intermediate Language Disassembler utility IsOneWay property, [OperationContract] (ildasm.exe) attribute, 1029 CIL code display, 27 IsPostBack property in HTTP Request processing, icons, 26 ASP.NET, 859 manifest display, 28 IsPrimitive, System.Type class, 396 overview, 26 IsSealed, System.Type class, 396 type metadata display, 28 IsTerminating property, [OperationContract] intermediate language (IL), 10 attribute, 1029 internal access modifier, 77 IsValueType, System.Type class, 396 internal representation of query operators IsVersion property, [Column] attribute, 1134 building query expressions using Sequence IsWellKnownClientType( ) method, type RemotingConfiguration, 580 and anonymous methods, 1120 ItemArray, ADO.NET DataRow object, 798 and lambdas, 1119–1120
escape characters, 124 LastAccessTime property, FileSystemInfo class, for, foreach looping, 67 519 foreach loop, 93 LastChildFill attribute, 1001 fully qualified type names, 134–136 LastWriteTime property, FileSystemInfo class, 519 garbage collection, 72 late binding GetCommandLineArgs( ), 67 description, 406 internal vs. external constant data, 81 invoking methods with no parameters, 407 is keyword, 107 invoking methods with parameters, 407–408 iteration, 92–93 overview, 391 local variable default values, 79 System.Activator class, 406–407 for loop, 92 layout, controls, 756–757 Main( ) method, 66 layout components, System.Windows.Forms, 606 member variable initialization syntax, 79–80 layout managers, 971 member visibility, 76–78 lease-based lifetimes, remoting, 592–597 method parameter modifiers, 89 legacy containers, 1116 namespaces, default Visual Studio 2005, 138 Length, FileInfo class, System.IO, 526 nested namespaces, 137–138 Length( ) method, Stream class, System.IO, 532 .NET formatting flags, 75–76 life cycle of a web page, ASP.NET, 861–863, 865 new keyword, 69–70 Line object, 1014 nullable types, 131, 133 LinearGradientBrush, System.Drawing.Brush, 681 objects, definition, 69 LinearGradientBrush element, 1006 overview, 65 LinearGradientBrush type, 1006, 1009 parameter-passing, 89–91 LINQ (Language Integrated Query), 959 parsing values from string data, 121 core assemblies, 1109–1110 passing reference types, 101–102 defining role of, 1107–1108 program structure, 65–66 entity classes read-only fields, 82–83 building using Visual Studio 2005, relational/equality operators, 94–96 1140–1142 static classes, 88 generating using sqlmetal.exe, 1134–1139 static constructors, 86–87 LINQ-specific assemblies, 1075 static data, 84–86 LINQ-specific namespaces, 1075 static keyword, 83–88 manipulating XML documents using LINQ to static methods, 84 XML static read-only fields, 83 loading and parsing XML content, 1146 string operations, 123–124 overview, 1142–1143 String.Concat( ) method, 124 programmatically creating XML documents, strings, 124 1144–1146 System data types, 117–120 System.Xml.XLinq namespace, 1143 System.Array, 130 navigating in-memory document System.Boolean, 120 modifying data in XML document, System.Char, 121 1148–1149 System.Console class, 73–75 overview, 1146 System.DateTime, 122 selecting elements using LINQ to XML, System.Environment class, 68–69 1146–1148 System.Nullable
querying relational databases using LINQ to managed heap, 180–184 SQL manifest, assemblies, 348 [Table] and [Column] attributes, 1133–1134 *.map file, 1041 building strongly typed DataContext, MapPath( ) method, ASP.NET HTTP Request, 858 1131–1133 mapping example, 1130–1131 C# types to CIL types, 492–493 overview, 1129–1130 DBMS names, ADO.NET, 813 role of DataContext type, 1130 parameters to variables, CIL, 498 role of entity classes, 1130 marshaling, remoting, 570 tokens, 1122 MaskedTextBox control, 707, 709 using to query generic collections master pages example, ASP.NET, 872–873 anonymous types, 1116 master panel, 1000 defining LINQ queries, 1115 MasterPageFile, ASP.NET, 846, 856 overview, 1114–1115 MathMessage delegate, 1104 using to query nongeneric collections, Maximum, Minimum properties, TrackBar 1116–1117 control, 724 LINQ Community Technology Preview (CTP), maxstack directive, common intermediate 1075, 1084, 1122, 1130 language (CIL), 497 overview, 966 MBV remoting, 586–589 repairing Visual Studio IntelliSense, 966–968 client assembly, 588–589 LINQ Console Application, 966, 1075 server assembly, 587–588 at faster it Find LINQ Preview installer program, 966 MDI applications, Visual Studio 2005, 646 List<> type, 1107 member variable initialization syntax, 79–80 ListBox control, 715–716 member visibility, 76–78 ListDictionary, System.Collections.Specialized, MemberInfo class, System.Reflection namespace, 253 396
Load, ASP.NET Page events, 862 MemberwiseClone( ), 112 http://superindex.apress.com/ Load( ) method, 436, 438, 1145 memory allocation (unsafe), 314–315 local variables memory management default values, 79 first rule, 180 implicitly typed second rule, 182 implicitly typed local arrays, 1079 third rule, 189 overview, 1076–1078 fourth rule, 192 restrictions on, 1078–1079 Finalize( ) vs. IDisposable interface, 194–195 LocalBuilder, System.Reflection.Emit namespace, resource wrapper final code example, 194 505 resource wrapper Microsoft code example, locals directive, common intermediate language 194–195 (CIL), 498 MemoryStream type, input/output, System.IO, Lock( ) method, ASP.NET HttpApplicationState 518 members, 898 menu components, System.Windows.Forms, 606 lock token and multithreaded applications, menu control example, ASP.NET, 873 469–471 Menu selection prompts, Visual Studio 2005, 639 locking memory (unsafe), 315 menu systems, Visual Studio 2005, 634, 636–637 looping, 92–93 Merge( ) method, ADO.NET DataSet class, 795 Lutz Roeder’s Reflector for .NET development message element, WSDL document elements, 938 tool, 62 Message property, System.Exception, 200, 210 message queuing, 1022 ■M MessageBox type, 977 machine.config, 388 metadata and type reflection, 392, 398–402 MachineName, System.Diagnostics.Process, 428 metadata exchange (MEX), 1035 MainModule, System.Diagnostics.Process, 428 metadata representation, 1108 maintaining session data, ASP.NET, 906–908 method group conversions, C# 2.0, 285–286 MainWindow class, 979, 981–982 method hiding, description, 169–170 MainWindow property, Application type, 973 method parameter modifiers, 89 MainWindow.g.cs file, 984 method parameters, common intermediate MainWindowHandle, System.Diagnostics.Process, language (CIL), 495 428 Method property, MainWindowTitle, System.Diagnostics.Process, System.MulticastDelegate/System 428 Delegate, 263 MainWindow.xaml.cs file, 988 MethodBuilder, System.Reflection.Emit managed code, overview, 8 namespace, 505 1170 ■INDEX
MethodInfo class, System.Reflection namespace, CLR thread pool, 475–476 396 concurrency, 450, 467–470 MethodName property, 1064 delegate review, 451, 453 methods EndInvoke( ), 453–454 common intermediate language (CIL), 494–495 execution speed vs. responsiveness, 465 in FontFamily, GDI+, 666 foreground vs. background threads, 466–467 MEX (metadata exchange), 1035 lock keyword and synchronization, 469–471 Microsoft Express IDEs, overview, 50 Main( ) method, 457 Microsoft Expression Interactive Designer, 992 overview, 449 Microsoft Expression nameplate, 992 secondary thread creation, 462–463 Microsoft Message Queuing service [MSMQ], 1021 state data, 458 Microsoft recommended event pattern, 281–282 synchronization, 450 Microsoft Vista developer page, 961, 964 synchronization attribute, 472–473 Microsoft Vista OS, 1026 synchronizing threads, 455–456 Microsoft.CSharp.targets file, 983 synchronous operations, 451–453 Microsoft.WinFX.targets file, 983 System.Threading Namespace, 459 milcore.dll binary, 972, 975 System.Threading.Interlocked type and Minimum, Maximum properties, synchronization, 471–472 NumericUpDown, 728 Thread class, 449 mnemonic keys in Label control, 704–705 thread relationship to process, AppDomain, mnemonics, CIL, 479 and context, 449–451 modifying application data, ASP.NET, 899–900 thread-volatile operations, 450 modifying tables, Command object, ADO.NET, Timer callbacks, 473–474 784–786 Mutex type, System.Threading Namespace, 459 Module class, System.Reflection namespace, 396 MyApp.g.cs file, 986, 988 module directive, common intermediate language MyApp.xaml.cs file, 988 (CIL), 488 MyDLinqObjects item, DLinqObjects, 1140 module set for a process example code, 432–433 MyExtensions type, 1083–1084 ModuleBuilder, 510 MyExtensions.cs, 1084 ModuleBuilder, System.Reflection.Emit MyExtensionsLibrary namespace, 1085 namespace, 505, 509 MyExtensionsLibrary.dll assembly, 1085 Modules, System.Diagnostics.Process, 428 myProxy.cs file, 1037 Monitor type, System.Threading Namespace, 459 MyUtilities namespace, 1083 MonthCalendar control, 719–721 MyWPFApp class, 977 MouseDown event, 1007, 1014 MoveTo( ) method ■N DirectoryInfo class, 520 Name, FileInfo class, System.IO, 526 FileInfo class, 526 Name attribute, 1004, 1032 mresources directive, common intermediate name clashes in interfaces, 229–231 language (CIL), 489 Name method, Thread type, 460–461 msbuild.exe utility, 983–984 Name property, 519, 1028, 1041, 1056, 1131, 1133 mscoree.dll, 20, 425 Name value, 1028 mscorlib.dll, 21 named property syntax, 1085 MSIL vs. CIL, 10 named style, 1009 MsmqIntegrationBinding binding class, WCF, 1025 NameLength property, 1062 multicasting, delegates, 262, 268–270 NameNotValid method, 1058 multifile assemblies, 11, 352, 362–365 namespace directive, common intermediate multiple base classes not allowed, 157 language (CIL), 489 multiple base interfaces, 233 namespace keyword, 133–134 multiple exceptions, 212–213 /namespace option, sqlmetal.exe command, 1134 multiple .NET Framework versions, 445 Namespace property, 1028 multiple result sets, DbDataReader object, namespaces ADO.NET, 784 default Visual Studio 2005, 138 multiple sort orders (IComparer), 245–246 examples in C#, VB.NET, C++, 22–23 multitabled DataSet objects, ADO.NET, 817–820 fully qualified names, 25 multithreaded applications overview, 22 AsyncCallback delegate, 456–457 primary .NET namespaces, 23 asynchronous operations, 453–454 programmatic access, 24–25 AsyncResult class, 457–458 System .NET namespace, 23 atomic operations, 450 System.Collections.Generic .NET namespace, BeginInvoke( ), 453–454, 456–458 23 ■INDEX 1171
System.Data .NET namespace, 23 installing Windows Software Development Kit System.Diagnostics .NET namespace, 23 (SDK) System.Drawing .NET namespace, 23 choosing installation option, 962 System.IO.Compression .NET namespace, 24 overview, 961 System.Net .NET namespace, 24 SDK contents, 962–964 System.Reflection .NET namespace, 24 overview, 957 System.Runtime.InteropServices .NET runtime components, installing, 960 namespace, 24 Software Development Kit, 959, 1023 System.Runtime.Remoting .NET namespace, 24 technologies, 957–958 System.Security .NET namespace, 24 utilities, 963 System.Threading .NET namespace, 24 netmodule file extension, 352, 362–364 System.Web .NET namespace, 24 NetMsmqBinding binding class, WCF, 1025 System.Windows.Forms .NET namespace, 24 netNamedPipeBinding binding class, 1025, 1044 System.Xml .NET namespace, 24 NetNamedPipeBinding type, 1043 NameValueCollection, NetPeerTcpBinding binding class, WCF, 1025 System.Collections.Specialized, 253 NetTcpBinding binding class, WCF, 1025 Nant development tool, 62 NetTcpBinding type, 1043 navigating between related tables, ADO.NET, new keyword, 69–70 820–821 CIL implementation, 181 NDoc development tool, 62 references, 180 nested namespaces, 137–138 New Project dialog, Visual Studio 2005, 964 at faster it Find nested panels, 1001–1002 NewLine, TextWriter, System.IO, 534 nested type definitions, 160–162 newobj CIL instruction, 181 .NET noautoinherit, 485, CIL compiler flags attributes, 1073 node images in TreeViews, 734, 736 base class libraries, 7 nonabstract .NET types, 980
basic building blocks overview, 6 nongeneric collections, using LINQ to query, http://superindex.apress.com/ code library, 1084 1116–1117 Common Language Infrastructure(CLI), 29–30 nonrectangular images, GDI+, 688, 690 common language runtime (CLR) overview, 6 nullable types, 131, 133 Common Language Specification (CLS) NullReferenceException, delegates, 267–268 overview, 6 numeric System data types, 120 Common Type System (CTS) overview, 6 NumericUpDown, 728 Configuration utility, 369–370, 382 Nunit development tool, 62 core features, 6 ECMA standardization, 29 ■O formatting flags, 75–76 Oberon programming language, 8 interoperability with COM, 6 object contexts Mono, 30 boundaries, 440 .NET-aware programming languages, 8–9 context 0, 440 non-Windows platforms, 29–30 context-agile, 441 overview, 6 context-bound, 441–442 Portable .NET, 30 overview, 425 as radical change, 6 program example, 442–443 reasons for learning, 3 object generations, 184 remoting, 1021–1022 object graph runtime deployment, 29 definition, 546 type metadata, 14–15 garbage collection, 182–183 Virtual Execution System (VES), 29 reachable objects, 182–183 web links to .NET-aware languages, 8–9 relationships, 547 .NET 1.x controls in Visual Studio 2005, 623 simple example, 546–547 .NET 3.0 object initializers syntax, 1085 base class libraries, 959 calling custom constructors with, 1087–1088 C# 3.0 and LINQ technologies, 959 initializing inner types, 1088 documentation, 964, 1050 overview, 1085–1087 installing C# 3.0 and LINQ Community understanding collection initialization, Technology Preview (CTP), 966–968 1089–1090 installing .NET Framework 3.0 Runtime object keyword, boxing, 104–106 Components, 960 object lifetime, 1022 installing Visual Studio 2005 “Orcas” object generations, 184 development tools, 964–965 overview, 179 1172 ■INDEX
System.GC, 185 “Orcas” Community Technology Preview, Visual when heap objects are removed, 180, 182 Studio 2005, 991 object oriented programming orderby operator, 1126 class, description, 139 orderby query operator, LINQ, 1122 class public interfaces, 143–144 OrderBy
ParameterName property, ADO.NET POST and GET data types, 940 DbParameter, 789 Predicate
philosophy of .NET, overview, 3 description, 365 http://superindex.apress.com/ PictureBox type, 684–686 identity, 365 PID (process identifier), 425, 429–431 probing, 366, 368 Pillars of OOP Process class, System.Diagnostics namespace, 428 encapsulation, 145–147 process identifier (PID), 425, 429–431 inheritance, 145–146, 154 processes overview, 4 definition, 425 polymorphism, 146, 162 module set example code, 432–433 PInvoke (Platform Invocation Services), 6 overview, 425 pixel unit of measure, GDI+, 660 process manipulation example code, 429–430 Platform Invocation Services (PInvoke), 6 starting and stopping example code, 434–435 Point types, 1086–1087 System.Diagnostics namespace, 427 pointer types and operators thread examination example code, 430–431 & operator, 312–313 ProcessExit event, System.AppDomain, 436, * operator, 312–313 439–440 > operator, 314 ProcessModule type, System.Diagnostics example, swap function, 313 namespace, 428 field access, 314 ProcessModuleCollection, System.Diagnostics table of operators, 310 namespace, 428 Point(F) type, System.Drawing namespace, ProcessName, System.Diagnostics.Process, 429 651–652 ProcessorAffinity, ProcessThread type, 432
RejectChanges( ) method, ADO.NET DataSet class, resource writers in .NET, 694 795 ResourceResolve event, System.AppDomain, 436 Release( ) not required in managed code, 181 resources, 691–697 remoting Resources global dictionary, 1009 alternative hosts, 597 Responding, System.Diagnostics.Process, 429 assemblies required, 574–575 Result property, 1058 asynchronous invocation, 602–603 result set, 1111 automatic server-side loading, 597 Resume( ) method, Thread type, 460 CAO activation, 572–573 .resx files, 691–693 channels, 568–569 ResXResourceWriter, 694 client-activated, 590–591 return value, interface used as, 228 client-side configuration files, 585–586 (ReturnValue) property, 1066 configuration files, 584 Reverse
installing a Windows service, 600–601 http://superindex.apress.com/ IPC channel, 568, 583 ■S lease configuration client-side adjustment, 596 Samples subdirectory, Windows SDK Installation lease configuration server-side adjustment, 595 Directory, 962 lease configuration settings, 594–595 SatelliteDLL folder, 967 lease sponsorship, 596 SaveAs( ) method, ASP.NET HTTP Request, 858 lease-based lifetimes, 592–597 saving CIL code using ildasm.exe, 481–483 marshaling, 570–571 Scheduling services, WF, 1050 MBV objects, 586–589 script block, ASP.NET, 847 .NET Framework architecture, 567 ScrollBar type, ContentControl base class, 974 one-way invocation, 604 ScrollBars property, Textbox, 705 overview, 565 sealed classes, 158–159, 164 proxies and messages, 567–568 Seek( ) method real proxy, 568 BinaryWriter class, 538 server-side configuration files, 584–585 Stream class, 532 singleton WKO activation, 573 select query operator, LINQ, 1122 singleton WKO and multiple clients, 581–582 SelectedIndex property, DomainUpDown, 728 TCP channel, 568, 582–583 SelectedItem property, DomainUpDown, 728 transparent proxy, 567 Semaphore type, System.Threading Namespace, Windows service construction, 597, 599 459 WKO activation, 572–573 separation of concerns, objects, 72 WKO and CAO configuration summary, 574 Sequence extension methods, 1119 remoting ChannelServices, 579 Sequence type, building query expressions using remoting namespaces, 566–567 and anonymous methods, 1120 RemotingConfiguration, 580 and lambdas, 1119–1120 RemotingFormat property, ADO.NET DataSet and raw delegates, 1120–1121 class, 795 SequenceActivity, WF, 1051 Remove( ) method, 263, 702, 908, 1142, 1148 Sequence.Distinct
serialization Shapes graphical service, WPF, 1011 BinaryFormatter object graph contents, 557 SharpDevelop IDE collections, 555–556 Assembly Scouts, 48 customizing using attributes, 560–561 download link, 46 customizing using ISerializable, 558–560 features, 47 definition, 545 installing or compiling, 46 GetObjectData( ) method, 558–560 overview, 46 IFormatter interface, 549 Project and Classes Scouts, 47 ISerializable interface, 557 Windows Forms Designers, 49–50 object graph, 546 shopping cart application, ASP.NET, 906–908 ObjectIDGenerator, 557 Show( ) method, 977 OnDeserializedAttribute, 557 Show Visual Tree button, 990 OnDeserializingAttribute, 557 ShowEndMessage method, 1070 OnSerializedAttribute, 557 ShowInstructions method, 1057 OnSerializingAttribute, 557 ShowMessage( ) method, 1070 OptionalField attribute, 562–563 Shutdown( ) method, 979 OptionalFieldAttribute, 557 SimpleInventory.xml file, 1145 overview, 545 SimpleMath type, 1104 persisting user preferences example, 545–546 SimpleXamlApp.csproj file, 984 public and private fields, public properties, 548 single call WKO activation, remoting, 573 Serializable attribute, 547–548 single file code model, ASP.NET, 842–843 SerializationInfo, 557 single unified object model, 957 System.Runtime.Serialization.Formatters. single-file assemblies, 11 Binary namespace, 548 singleton WKO activation, remoting, 573 type fidelity, 550 sink object, callback interfaces, 256–257, 259 versioning, 561–563 Size property, ADO.NET DbParameter, 789 SerializationInfo, serialization, 557 sizeof keyword, 316 Serialized attribute, 409 SkinID property, System.Web.UI.Control in server controls in ASP.NET, 865–866 ASP.NET, 867 /server option, sqlmetal.exe command, 1134 Sleep( ) method, Thread type, 460 Server property, WebService base class, 929 SmallChange property, TrackBar control, 724 server-side configuration files, remoting, 584–585 Smalltalk .NET programming language, 8 Service Configuration Editor, 1043 SMEs (subject matter experts), 1048 service contracts, 1024, 1026–1027 sn.exe, strong name utility, 371, 373, 375–376 service element, WSDL document elements, SOAP bindings, 941–942 939–940 SOAP transport of web service, 922 Service References folder, Solution Explorer, 1041 SoapFormatter, serialization, 548, 552 service types, 1024, 1026 SoapHttpClientProtocol class, 944–945
role of DataContext type, 1130 StreamWriter, 518, 533, 536 role of entity classes, 1130 StringCollection, System.Collections.Specialized, SqlConnectionStringBuilder type, 1131 253 sqlmetal.exe, generating entity classes using, 1134 String.Concat( ) method, 124 defining relationships using entity classes, StringDictionary, System.Collections.Specialized, 1136–1137 253 overview, 1134–1136 StringEnumerator, programming against generated types, System.Collections.Specialized, 253 1138–1139 String.Format( ) method, 76 strongly typed DataContext, 1137–1138 StringReader, StringWriter, System.IO, 536–537 stack, and value based types, 96 strings Stack System.Collections class type, 250–253 comparing, 124 stackalloc keyword, 314–315 internal .NET string processing, 126 stack-based programming, 480 iterating over, 124 StackPanel control, WPF Panel, 994, 1015 StringWriter, StringReader types, input/output, StackPanel panels, 998–999 System.IO, 518
startButton control, 1015 configuring exception state, 204 http://superindex.apress.com/ starting and stopping a process example code, custom exceptions, 209–210 434–435 entities used in, 199 StartTime, 429, 432 exceptions, description, 197 Startup event handler, 978 finally block, 215–216 StartupEventArgs delegate, 977 generic exceptions, 202, 213 StartupEventHandler delegate, 977 inner exceptions, 214–215 StartupLocation.CenterScreen value, 986 keywords used, 199 StartupPath property, Application class, 609 multiple exceptions, 212–213 StartupUrl property, 973, 982, 986 overview, 197 state data, multithreaded applications, 458 possible .NET exceptions, 216 state machine workflows, 1052 rethrowing exceptions, 214 state management simple example, 200–204 overview, 889 System.Exception, 199–204 problems, 889–891 system-level exceptions, 208 techniques, 891, 1022 System.Serializable attribute, 211 State member, ServiceHost type, 1033 template, exception, 211 State property, DbConnection, ADO.NET, 779 throwing an exception, 202–203 stateful data, XML web services, 933, 935 traditional exception handling, 198 stateless, description, HTTP, 830 try/catch block, 203–204 static assemblies, 504 typed exceptions, 217 static class, 153–154, 1080 unhandled exceptions, 217 static helper method, 1110, 1122 user errors, description, 197 static keyword, 83–88 Visual Studio 2005 features, 216–219 static readonly keywords, 83 structures static web service discovery using DISCO, 921 common intermediate language (CIL), 491 StatusBar vs. StatusStrip, 633 and enumerations, value based types, 97 StatusStrip, Visual Studio 2005, 633–634, 636–637 in XML web services, 949–950 stored procedures using DbCommand, ADO.NET, styles, Windows Presentation Foundation (WPF), 790–791 1008–1010 [StoredProccedure] attribute, 1138 subject matter experts (SMEs), 1048 storyboards, 975 SubmitChanges( ) method, 1141 Stream class, System.IO, 531–532 submitting form data, ASP.NET, 837–838 StreamReader, 518, 533, 536 subset variable, 1112 1178 ■INDEX
subsystem directive, common intermediate System.Collections.Specialized.ListDictionary, language (CIL), 489 indexer technique, 291–292 Suspend( ) method, Thread type, 460 System.ComponentModel namespace, 746, 1136 SuspendActivity, WF, 1051 System.ComponentModel.Component, 612 SvcConfigEditor.exe tool, 1043 System.Configuration namespace, 387, 1031 svcutil.exe command-line tool, 1038 System.Configuration.dll assembly, 1031 switch statement, 95–96 System.Console class, 73–75 Synchronization attribute, 442, 472–473 basic I/O, 73 synchronizing threads, 455–456 formatting output, 74–75 synchronous delegate call, 260 tokens, 74–75, formatting output System data types, 117–118 System.ContextBoundObject, 441 System.Activator class, late binding, 406–407 System.Data, ADO.NET, 764–765 System.AppDomain class Contraint, 764 AssemblyLoad event, 436 System.Data.DLinq namespace, 1130, 1132 AssemblyResolve event, 436 System.Data.DLinq.dll assembly, 1109 BaseDirectory( ), 436 System.Data.Extensions.dll assembly, 1109 CreateDomain( ), 435, 437 System.DateTime, 122 CreateInstance( ), 436 System.Delegate base class, 262 DomainUnload event, 436 System.Diagnostics namespace, 428 ExecuteAssembly( ), 436 System.Diagnostics.Process, 428–429 GetAssemblies( ), 436 System.Drawing namespace, 650–653 GetCurrentThreadId( ), 435 core types, 650–651 Load( ), 436, 438 GDI+, 650 ProcessExit event, 436 Point(F) type, 651–652 ResourceResolve event, 436 Rectangle(F) type, 652–653 TypeResolve event, 436 Region class, 653 UnhandledException event, 436 utility types, 651 Unload( ), 436, 439–440 System.Drawing.Brush, 677 System.ApplicationException, 208–210 System.Drawing.dll, 969 System.Array, 130, 1110, 1113 System.Drawing.Drawing2D, 672–676 System.Boolean, 120, 1077 System.Drawing.Font, GDI+, 665 System.Char, 121 System.Drawing.Graphics class SystemCLSCompliant( ), 20, CLS compliance methods, 653 verification Paint sessions, 655–656 System.Collection namespace, 1089 properties, 654 System.Collection.ArrayList, indexer technique, System.Drawing.Graphics class, GDI+, 653 290–291 System.Drawing.Graphics type, 1010 System.Collections class types, 249 System.Drawing.Image, 682, 684 ArrayList, 250–251 System.Drawing.Imaging, GDI+ namespaces, 650 Hashtable, 250 System.Drawing.Printing, GDI+ namespaces, 650 Queue, 250–252 System.Drawing.Text, GDI+ namespaces, 650 SortedList, 250 System.Enum, 109–110 Stack, 250–253 System.Environment class, 68–69 System.Collections interfaces System.EventArgs argument, 1061 ICollection, 247–248 System.EventHandler, Application Exit, 611 IDictionary, 247–248 System.EventHandler delegate, 1061 IDictionaryEnumerator, 247–249 System.Exception IEnumerable, 247 Data property, 200, 206–207 IEnumerator, 247 HelpLink property, 200, 206 IHashCodePRovider, 247 InnerException property, 200 IKeyComparer, 247 Message property, 200, 210 IList, 247–249 StackTrace property, 200, 205 System.Collections.Generic namespace, 1114 TargetSite property, 200, 204 overview, 321 System.GC, 185–187 System.Collections.Generic.List<> System.Guid, 240–242 classes, 326–329 System.IdentityModel.dll assembly, WCF, 1023 generics, 325 System.Int32, 1077 naming convention, 327 System.MarshalByRefObject, 572, 612 nongeneric namespaces, 327–329 System.MulticastDelegate base class, 262 nongeneric namespaces mimicked, 326 System.MulticastDelegate/System Delegate System.Collections.Specialized, 253 members, 263 ■INDEX 1179
System.Nullable
System.Reflection.Emit namespace, 509 System.Text.StringBuilder, 126–127 http://superindex.apress.com/ creating dynamic CIL assemblies, 505 System.Threading Namespace overview, 477 Interlocked type, 459 System.Reflection.Emit.ILGenerator, 506 Monitor type, 459 System.Resources namespace, 691 Mutex type, 459 System.Runtime.CompilerServices namespace, ParameterizedThreadStart delegate, 459, 1084 462–463, 465–466 System.RuntimeRemoting, remoting namespace, Semaphore type, 459 566 Thread type, 459–460 System.Runtime.Remoting.Activation, remoting ThreadPool type, 459, 475–476 namespace, 566 ThreadPriority enum, 459 System.Runtime.Remoting.Channels, remoting ThreadStart delegate, 459, 463–464 namespace, 566 ThreadState enum, 459 System.Runtime.Remoting.Channels.Http, Timer type, 459 remoting namespace, 566 TimerCallback delegate, 459, 473–474 System.Runtime.Remoting.Channels.Ipc, System.TimeSpan, 122 remoting namespace, 566 System.Type class, 396–397 System.Runtime.Remoting.Channels.Tcp, System.Uri type, 1026, 1031 remoting namespace, 566 System.ValueType, 97, 222 System.Runtime.Remoting.Contexts, remoting System.Web namespace, ASP.NET 2.0, 842 namespace, 566 System.Web.Caching namespace, ASP.NET 2.0, System.Runtime.Remoting.Lifetime, remoting 842 namespace, 566 System.Web.Hosting namespace, ASP.NET 2.0, 842 System.Runtime.Remoting.Messaging, remoting System.Web.Management namespace, ASP.NET namespace, 566 2.0, 842 System.Runtime.Remoting.Metadata, remoting System.Web.Profile namespace, ASP.NET 2.0, 842 namespace, 566 System.Web.Security namespace, ASP.NET 2.0, 842 System.Runtime.Remoting.MetadataServices, System.Web.Services.Configuration, XML web remoting namespace, 566 services namespaces, 922 System.Runtime.Remoting.Metadata.W3cXsd2001, System.Web.Services.Description, XML web remoting namespace, 566 services namespaces, 922 System.Runtime.Remoting.Proxies, remoting System.Web.Services.Discover, XML web services namespace, 567 namespaces, 922 System.Runtime.Remoting.Services, remoting System.Web.Services.Protocols, XML web services namespace, 567 namespaces, 922 1180 ■INDEX
System.Web.ServicesXML web services Target property, namespaces, 922 System.MulticastDelegate/System System.Web.SessionState namespace, ASP.NET Delegate, 263 2.0, 842 *.targets files, 983–984 System.Web.UI.Control in ASP.NET, 867 TargetSite property, System.Exception, 200, 204 System.Web.UI.Page, ASP.NET, 856 TCP channel, remoting, 568, 582–583 System.Web.UI.x namespace, ASP.NET 2.0, 842 template, exception code expansion, 211 System.Window.Application class type, 973 templating services, 975 System.Windows namespace, WPF, 972 TerminateActivity, WF, 1051 System.Windows.Controls namespace, 972, 979, TesterUtilClass class, 1081, 1083 994, 1004 text based Windows.Forms coding, 606 System.Windows.Controls.ContentControl base Text property, UpDownBase, 728 class, 974–975 TextAlign property System.Windows.Controls.Control base class, 975 Button, 709 System.Windows.DependencyObject base class, Textbox, 705 976 UpDownBase, 728 System.Windows.Forms, 605–606, 699 Textbox System.Windows.Forms.ContainerControl, 612 AcceptsReturn property, 705 System.Windows.Forms.Control, 612–613 CharacterCasing property, 705 System.Windows.Forms.dll, 969 PasswordChar property, 705 System.Windows.Forms.Form, 612 ScrollBars property, 705 System.Windows.Forms.Form-derived type, 979 TextAlign property, 705 System.Windows.Forms.ScrollableControl, 612, TextBox control, 705–707 Form object inheritance chain TextPad development editor, 41 System.Windows.FrameworkElement base class, C Shart Helpers clip library, 45 975 configuring for C#, 42–43 System.Windows.Markup namespace, WPF, 972 executing programs, 44 System.Windows.Media namespace, WPF,972 predefined run commands, 44–45 System.Windows.Media.Visual base class, 975–976 TextReader, System.IO, 535 System.Windows.Navigation namespace, WPF, 972 TextureBrush, System.Drawing.Brush, 679–680 System.Windows.Shapes namespace, 972, 1012 TextWriter, System.IO, 534 System.Windows.Threading.DispatcherObject Theme, Page Type properties, ASP.NET, 857 base class, 976 this keyword, 142–143, 1080 System.Windows.UIElement base class, 975 this[ ] syntax, indexer technique, 290–291 System.Windows.Window type, 973 ThousandsSeparator property, NumericUpDown, System.Workflow.Activities core namespace, 1054 728 System.Workflow.Activities namespace, 1051 Thread class, 449 System.Workflow.Activities.dll core assembly, 1054 Thread type, System.Threading Namespace, System.Workflow.ComponentModel.dll core 459–462 assembly, 1054 ThreadExit event, Application class, 609 System.Workflow.Runtime core namespace, 1054 Thread.GetDomain( ), 449 System.Workflow.Runtime.dll core assembly, 1054 ThreadPool type, System.Threading Namespace, System.Workflow.Runtime.Hosting core 459, 475–476 namespace, 1054 ThreadPriority enum, System.Threading System.Xml namespaces, 1108 Namespace, 459 System.Xml.dll assembly, 1143 threads System.Xml.Serialization namespace, 1043 example code, 430–431 System.Xml.XLinq namespace, 1143 hyperthreading, 427 System.Xml.XLinq.dll assembly, 1109 multithreading, 426 overview, 426 ■T suspended during garbage collection, 182 T input parameter, 1097 Thread Local Storage (TLS), 427 tab order for controls, 718 time slice, 427 TabControl control, 722–723 Threads, System.Diagnostics.Process, 429 Table, ADO.NET DataRow object, 798 ThreadStart delegate, System.Threading Table property, ADO.NET DataColumn object, 797 Namespace, 459, 463–464 [Table] attribute, 1133–1134 ThreadState enum, System.Threading Table
ThrowException( ) method, TypeBuilder, System.Reflection.Emit namespace, System.Reflection.Emit.ILGenerator, 506 505 TickFrequency property, TrackBar control, 724 typed exceptions, structured exception handling, TickStyle property, TrackBar control, 724 217 time slice, 427 typed parameter, 1099 Timeout( ) method, SoapHttpClientProtocol class, TypeDef, 392 945 typeof operator, 398 TimeoutDuration property, Properties window, TypeRef, 392 1070 TypeResolve event, System.AppDomain, 436 Timer type, 459, 1014 types, five categories of, 15 TimerCallback delegate, System.Threading types element, WSDL document elements, 937 Namespace, 459, 473–474 ToArray< >( ) member of the Sequence type, 1129 ■U tokens, 74–75, 707 UDDI discovery of XML web services, 921, ToList< >( ) member of the Sequence type, 1129 953–954 ToolBar components in ToolStrips, 639–641 UDT (user-defined type), definition, 69–70 Tools pop-up folder, 963 UIElement base class, 975 ToolStripMenuItem types, Visual Studio 2005, unbound type parameters, 335–336 632–633 unboxing custom value types, 106 ToolStrips in Visual Studio 2005, 639–641 unchecked keyword, 309 idi atrat faster it Find ToolTip control, 721–722 unhandled exceptions, structured exception ToString( ) method, 112, 1092–1093, 1122, 1131 handling, 217 TotalProcessorTime, ProcessThread type, 432 UnhandledException event, System.AppDomain, Trace, ASP.NET <%@Page%> directive attribute, 436 846 unification, 957 Trace, Page Type properties, ASP.NET, 857 uninstalling beta software, 959 trace element, Web.config, ASP.NET, 913–914 unique namespace, 1083 http://superindex.apress.com/ TrackBar control, 724–726 Unique property, ADO.NET DataColumn object, Tracking services, WF, 1050 797 “traditional” delegate syntax, 1097 unit of measure, GDI+, 660 Transaction object, ADO.NET data providers, 761 Unload, ASP.NET Page events, 862 Transaction services, WF, 1050 Unload( ) method, System.AppDomain, 436 Transformations graphical service, WPF, 1012 Unlock( ) method, ASP.NET HttpApplicationState transforming XML documentation to HTML, 177 members, 898 transparent proxy, remoting, 567 unmanaged resources, 185, 189–195 transport, 1025 Unregister( ) method, ILease interface remoting, TreeView controls, 731–736 593 tunneling events, 1008 UnregisterChannel( ) method, remoting type, determining, 172 ChannelServices, 579 type access modifiers, 78 unsafe compiler flag, 310 type constructors, common intermediate unsafe keyword, 311–312 language (CIL), 494 untyped messages, 1022 type parameters, 321 Update( ) method, ADO.NET, data adapter, 811 type reflection Update Service Reference option, 1041 AssemblyRef, 394 UpdateCheck property, [Column] attribute, 1134 description, 395 UpdateCommand property in updating, example metadata, 393–394 ADO.NET, 815 external private assemblies, 402–403 updating fields and properties, 398 applications using shared assemblies, 378–379 implemented interfaces, 399 records, ADO.NET, 787 metadata and type reflection, 391–392 using data adapter objects, ADO.NET, 813–815 method parameters and return values, 401–402 UpDown control, 727, 729 methods, 398 UpDownAlign property, UpDownBase, 728 other metadata, 399 UpDownBase, 728 overview, 391 Url( ) method, SoapHttpClientProtocol class, 945 shared assemblies, 404–406 user errors, description, 197 TypeDef, 392 user interface in HTML, 834–835 TypeRef, 392 /user option, sqlmetal.exe command, 1134 User Strings, 395 UserAgent( ) method, SoapHttpClientProtocol type visibility, 78 class, 945 UserControl Test Container, 743 1182 ■INDEX
user-defined type (UDT), definition, 69–70 Class View, 53 userName string member variable, 1058 Code Definition window, 54 using directives, 1110 code refactoring support, 55 using ILIDE#, compiling common intermediate command prompt, 967 language (CIL), 486 ContextMenuStrip controls, 626, 630–632 using keyword, aliases, 136–137 deprecated controls, 623 using statements, 1031 designer.cs form file, 624 UsingNamespace( ) method, event handling in ToolStrips, 643 System.Reflection.Emit.ILGenerator, 506 event registration, 280–281 form files in a project, 623 ■V forms designer, 621 Validated, control class property, 730 FxCop, 62 ValidateInput( ) method, ASP.NET HTTP Request, generating resources, 694–697 858 handling events, 625 Validating, control class property, 730 images in ToolStrips, 641–643 validation controls, ASP.NET integrated Help system, 60–61 CompareValidator control, 884, 887 interface implementation, 234–235 CustomValidator control, 884 Lutz Roeder’s Reflector for .NET, 62 RangeValidator control, 884, 886 MDI applications, 646 RegularExpressionValidator control, 884, 886 menu items in controls, 632 RequiredFieldValidator control, 884–885 Menu selection prompts, 639 ValidationSummary control, 884, 887 Menu selection ready state, 639 value and reference types, conversion, 104–106 menu systems, 634–637 Value property MenuStrip controls, 626–630 ADO.NET DbParameter, 789 NAnt, 62 NumericUpDown, 728 NDoc, 62 TrackBar control, 724 .NET 1.x controls, 623 value types and reference types, 96–104 New Project dialog box, 964 value-based semantics, 1094 Nunit, 62 var keyword, 1076–1077, 1090, 1098, 1113 Object Browser, 54 variable declaration, 1113 Object Test Bench, 60 variables, local, common intermediate language “Orcas” Community Technology Preview, 1109 (CIL), 498 “Orcas” development tools, installing, 964–965 Variant data type, 1079, COM overview, 51, 621 VB6 language deficiencies, 4 Program class, 625 VB.NET operator overloading, 300 project configuration (Project Properties), 53 vector graphics, 971 project templates, 621 verbatim strings, 125 properties window, 622 version number of assemblies, 348 refactoring example, 56 VeryComplexQueryExpression class type, 1120 refactoring techniques available, 55 view objects, ADO.NET, 810 Snippets automated coding, 57 view state, state management in ASP.NET, 891–893 Solution Explorer, 52 /views option, sqlmetal.exe command, 1134 StatusStrip, 633–637 Vil development tool, 62 Surround With automated coding, 57 virtual execution stack, 480 Timer, 637–638 virtual keyword, description, 162, 164 Toolbox, 621 Visible property, System.Web.UI.Control in ToolStrip containers, 643–645 ASP.NET, 867 ToolStripMenuItem types, 632–633 Vista operating system (OS), 957 ToolStrips, 639–641 Visual Basic .NET integration with C#, 360–365 Vil, 62 Visual Basic snap-in example, 420–421 Visual Class Designer, 57–59 Visual C# 2005 Express, 51 Visual Studio 2005 Extensions for Windows Visual C++ Compilers options, 962 Workflow Foundation, installing, 964–965 Visual Studio 2005 Visual Studio IntelliSense, repairing, 966–968 additions available, 52 automated coding support, 57 ■W building entity classes using WaitReason, ProcessThread type, 432 deleting existing items, 1142 WAS (Windows Activation Services), 1026 inserting new items, 1141 WCF. See Windows Communication Foundation overview, 1140–1141 WCF *.config file, 1024 updating existing items, 1142 ■INDEX 1183
Web Application Administration utility, ASP.NET, website directory structure, ASP.NET, 851 916–917 WF. See Windows Workflow Foundation web applications in ASP.NET where keyword, generics, 337 application cache, 901 where operator, 1125, 1148 application level state data, 898–899 where query operator, LINQ, 1122 application shutdown, 900 Where
site administration utility, 916–917 System.Windows.Threading.DispatcherObject http://superindex.apress.com/ state management, 889–891 base class, 976 Web Application Administration utility, System.Windows.UIElement base class, 975 916–917
hosting WCF service motivation behind overview, 1030–1031 overview, 969–970 role of ServiceHost type, 1032–1033 providing optimized rendering model, 971 motivation behind, 1021–1022 providing separation of concerns via XAML, overview, 1021 970–971 Windows Distributed interNet Applications overview, 969 Architecture (DNA) deficiencies, 5 separation of concerns using code-behind files, Windows Forms, 969 988–989 message boxes, 1072 transforming markup into .NET assembly snap-in example, 421–422 mapping XAML to C# code, 984–985 Windows forms controls, 699 overview, 984 Windows objects and Graphics objects, GDI+, 657 role of Binary Application Markup Language Windows Presentation Foundation (WPF), 958, (BAML), 986–987 964, 1021, 1143 XAML-to-assembly process summary, assemblies 987–988 overview, 972–973 Windows property, Application type, 973 role of Application class, 973 Windows service, 600–601, 1030 role of Window class, 974–976 Windows Software Development Kit (SDK), building WPF applications, using Visual Studio installing (VS) 2005 “Orcas,” 991–992 choosing installation option, 962 building XAML-free WPF applications overview, 961 creating simple user interface, 979–980 SDK contents, 962–964 extending Window class type, 978 Windows Vista Headers and Libraries, 962 overview, 976–978 Windows Vista operating system, 971 controlling content layout using panels, 993 Windows Workflow Foundation (WF) building Window’s Frame using nested assemblies and core namespaces, 1054 panels, 1001–1002 brief word regarding custom activities, Canvas panels, 994–996 1072–1073 DockPanel panels, 1000–1001 building blocks of Grid panels, 999–1000 getting into flow of workflow, 1053–1054 overview, 994 integrated services of WF,1049–1050 StackPanel panels, 998–999 overview, 1048–1049 WrapPanel panels, 996–998 role of sequential workflows and state controls machine workflows, 1051–1053 configuring, 1003–1004 WF activities, 1050–1051 control events, 1006–1008 building reusable code library overview, 1002–1003 authoring simple workflow, 1070–1071 properties, 1004–1006 creating WF-enabled application, 1071–1072 styles, 1008–1010 overview, 1069–1070 experimenting with XAML using XamlPad, 989 building simple workflow-enabled application Extensible Application Markup Language adding Code activity, 1056–1057 (XAML) adding custom start-up parameters, Browser Applications (XBAPs), 1017–1018 1061–1063 defining application object in, 982 adding While activity, 1057–1059 defining MainWindow in, 981–982 initial workflow code, 1055–1056 experimenting with using XamlPad, 990–991 overview, 1055 generating using Microsoft Expression WF engine hosting code, 1060 Interactive Designer, 992 invoking web services within workflows overview, 980–981 overview, 1063–1067 processing XAML files via msbuild.exe, working with IfElse activity, 1067–1069 983–984 motivation behind, 1047–1048 graphical rendering services overview, 1047 breaking down graphical services of Windows Workflow toolbox, 1050 Windows Presentation Foundation Windows XP Home Edition, and ASP.NET, 832 (WPF), 1011–1012 WindowsBase.dll assembly, WPF, 972 generating XAML using Microsoft Windows.Forms coding Expression Graphical Designer, 1016 += operator, 610 overview, 1010–1011 Application class, 609 working with basic shapes, 1012–1014 ApplicationExit event, 609–610 WPF animation services, 1014–1016 coding the main window, 607–608 Form class, 607 ■INDEX 1185
Form object inheritance chain, 611 ■X by hand, 606 X property, 1086 keyboard input, 614, 617 XAML (Extensible Application Markup Language), mouse events, 615–617 958, 969 overview, 606 Browser Applications (XBAPs), 1017–1018 reflecting static attributes, 609 building XAML-free WPF applications responding to events, 614–617 creating simple user interface, 979–980 separating Main( ) method from main window, extending Window class type, 978 608 overview, 976–978 System.EventHandler, 611 defining application object in, 982
WPF. See Windows Presentation Foundation namespace, 1143 http://superindex.apress.com/ Wrap property, DomainUpDown, 728 Xcopy deployment, 365 WrapPanel control, WPF Panel, 994 XDeclaration member, System.Xml.XLinq WrapPanel panels, 996–998 namespace, 1143 Write( ) method XDocument member, System.Xml.XLinq ASP.NET HTTP Response, 860 namespace, 1143 BinaryWriter class, 538 XElement member, System.Xml.XLinq Stream class, System.IO, 532 namespace, 1143 TextWriter, System.IO, 534 XElement object, 1144 WriteByte( ) method, Stream class, System.IO, 532 XElement.Descendants( ) method, 1147 WriteFile( ) method, ASP.NET HTTP Response, 860 XElement.Load( ) method, 1147 WriteLine( ) method, TextWriter, System.IO, 534 XML write-only class properties, 153 and ADO.NET, 759 WriteXml( ), WriteXmlSchema( ) method, code comment format characters, 176 ADO.NET DataSet class, 795 configuration files, 1026 writing to text file, 534–535 /doc compiler flag, 176 WS Coordination protocols, 1022 documentation elements, 174 WS-AT (WS-AtomicTransaction), 1022 source code documentation, 174–177 WSDL. See Web Service Description Language transforming to HTML, 177 wsdl.exe utility, XML web services XML documents, manipulating using LINQ to /appsettingurlkey flag, 942 XML creating a client-side proxy, 944 loading and parsing XML content, 1146 generating server-side code, 943 overview, 1142–1143 /language flag, 942, 944 programmatically creating XML documents, /namespace flag, 942 1144–1146 /out flag, 943 System.Xml.XLinq namespace, 1143 /protocol flag, 943–944 /xml option, sqlmetal.exe command, 1134 /serverInterface flag, 943 XML System.Web.Services namespace, 923 WSDualHttpBinding binding class, WCF, 1024 XML web services WSFederationHttpBinding binding class, WCF, <%@WebService%> directive, 923 1025 ADO.NET datasets using web methods, 950 WSHttpBinding binding class, WCF, 1024 arrays using web methods, 949 WSI basic profile (BP 1.1) conformance, XML web asynchronous invocation, wsdl.exe utility, services, 932 946–947 WsiProfiles enumeration, XML autogenerated test page, 925 System.Web.Services namespace, 923 1186 ■INDEX
benefits, 919–920 Web Service Description Language (WSDL), client architecture, 920 935 client-side representation, 952–953 web.config and session state, 935 custom test page, 925–926 web.config file, 941 custom types using web methods, 948 WebDev.WebServer.exe, 924 default constructor, wsdl.exe utility, 945 WebMethod attribute, 923, 932 DefaultWsdlHelpGenerator.aspx, 925–926 WebService base class, 929 Description property, 930 WebServiceAttribute, 929–930 description service, description, 921 WebServiceBinding attribute, 931 DISCO UDDI directory, 921 Windows Forms clients, 951–952 discovery service, description, 921 wire protocols, 940 dynamic web service discovery using DISCO, WSDL description, 921 921 WSDL document, 937 example application, wsdl.exe utility, 947 WSDL document elements, 936–940 example web service, 928–929 WSDL first approach, 936 HTTP GET, 940 WSDL name clashes, 933 HTTP POST, 940 WSDL Service Description, 925 HTTP SOAP, 940 wsdl.exe utility, 942–947 HTTP transport, 922 WSI basic profile (BP 1.1) conformance, 932 HTTP use, 919–920 XmlAttributeAttribute, XmlSerializer, 554 IIS deployment, 925 XML-based grammar (XAML), 1143 machine.config file, 940 XmlElementAttribute, XmlSerializer, 554 manual web service coding, 923 XmlEnumAttribute, XmlSerializer, 554 Name property, 930 XmlFormatter, 1039 Namespace property, 930 XmlRootAttribute, XmlSerializer, 554 namespaces, 922 XmlSerializer, 548–549, 553–555, 1042–1043 overview, 919 [XmlSerializerFormat] attribute, 1043 vs. proprietary wire protocols, 919–920 XmlTextAttribute, XmlSerializer, 554 proxy code using Visual Studio 2005, 947–948 XmlTypeAttribute, XmlSerializer, 554 role, 919–920 XName member, System.Xml.XLinq namespace, session state and web.config, 935 1143 SOAP body, 941 XName parameter, 1145 SOAP envelope, 941–942 XNamespace member, System.Xml.XLinq SOAP transport, 922 namespace, 1143 stateful data, 933, 935 xPos member variable, 1086 static web service discovery using DISCO, 921 structures using web methods, 949–950 ■Y synchronous invocation, wsdl.exe utility, 946 Y property, 1086 System.Web.Services namespace, 922 yetAnotherPoint shorthand notation, 1086 transport protocol, description, 921 yield keyword, 237–238 UDDI and Visual Studio .NET, 954 yPos member variable, 1086 UDDI discovery, 921, 953–954 using Visual Studio.NET, 926–928 viewing SOAP messages, 942