Book description
This book starts by reviewing the overall architecture of .NET in order to give you the background you need to be able to write managed code. After that, the book is divided into a number of sections that cover both the C# language and its application in a variety of areas.
Part I: The C# Language: This section gives a good grounding in the C# language itself. This section doesn't presume knowledge of any particular language, although it does assume you are an experienced programmer. You start by looking at C's basic syntax and data types, and then explore the object-oriented features of C# before moving on to look at more advanced C# programming topics. Objects, types, inheritance, generics, arrays, tuples, operators, casts, delegates, lambdas, events, strings, regular expressions, collections, Language Integrated, Query (LINQ), Dynamic Language Extensions, memory management, pointers, reflection, errors, and exception are all covered in part 1.
Part II: Visual Studio: This section looks at the main IDE utilized by C# developers worldwide: Visual Studio 2010. The two chapters in this section look at the best way to use the tool to build applications based on the .NET Framework 4. In addition, this section also focuses on the deployment of your projects.
art III: Foundation: In this section, you look at the principles of programming in the .NET environment. In particular, you look at assemblies, instrumentation, security, threading, tasks, synchronization, localization, System.Transactions, networking, interop, XAML, Managed Extensibility Framework, Manipulating Files and the Registry, transactions, how to build Windows services, and how to generate your own libraries as assemblies, among other topics.
Part IV: Data: Here, you look at accessing databases with ADO.NET, ADO.NET Entity Framework, data services. This part also extensively covers support in .NET for XML and on the Windows operating system side, and the .NET features of SQL Server 2008.
Part V: Presentation: This section shows how to build applications based upon the Windows Presentation Foundation and Silverlight, and covers writing components that will run on web sites, serving up web pages. It also has coverage on building classic Windows applications, which are called Windows Forms in .NET. Windows Forms are the thick-client version of applications, and using .NET to build these types of applications is a quick and easy way of accomplishing this task. Finally, it includes coverage of the tremendous number of features that ASP.NET, ASP.NET MVC, and ASP.Net Dynamic Data provide.
art VI: Communication: This section is all about communication. It covers services for platform-independent communication using the Windows Communication Foundation (WCF). With Message Queuing, asynchronous disconnected communication is shown. This section looks at utilizing the Windows Workflow Foundation 4, as well as peer to peer networking, and creating syndication feeds.
The book closes with an appendix covering Windows 7 and Windows Server 2008 R2 development.
Online Chapters: Even with such a large book, we can't fit in everything we'd like to tell you about C# and using this language with other .NET technologies, so we've made ten additional chapters available online at wrox.com. These chapters include information on a variety of topics: GDI+, which is a technology that is used for building applications that include advanced graphics; .Visual Studio Tools for Office (VSTO); NET Remoting for communication between .NET clients and servers; Enterprise Services for the services in the background; web services with ASP.NET, LINQ to SQL, Windows Workflow Foundation 3.0, and the Managed Add-In Framework (MAF). It also includes examples showing .NET 4 in others supported languages including Visual Basic, C++/CLI, and F#.
Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.
Table of contents
- Copyright
- ABOUT THE AUTHORS
- ABOUT THE TECHNICAL EDITORS
- CREDITS
- ACKNOWLEDGMENTS
- INTRODUCTION
-
I. The C# Language
-
1. .NET Architecture
- 1.1. THE RELATIONSHIP OF C# TO .NET
- 1.2. THE COMMON LANGUAGE RUNTIME
- 1.3. A CLOSER LOOK AT INTERMEDIATE LANGUAGE
- 1.4. ASSEMBLIES
- 1.5. .NET FRAMEWORK CLASSES
- 1.6. NAMESPACES
- 1.7. CREATING .NET APPLICATIONS USING C#
- 1.8. THE ROLE OF C# IN THE .NET ENTERPRISE ARCHITECTURE
- 1.9. SUMMARY
-
2. Core C#
- 2.1. YOUR FIRST C# PROGRAM
- 2.2. VARIABLES
- 2.3. PREDEFINED DATA TYPES
- 2.4. FLOW CONTROL
- 2.5. ENUMERATIONS
- 2.6. NAMESPACES
- 2.7. THE MAIN() METHOD
- 2.8. MORE ON COMPILING C# FILES
- 2.9. CONSOLE I/O
- 2.10. USING COMMENTS
- 2.11. THE C# PREPROCESSOR DIRECTIVES
- 2.12. C# PROGRAMMING GUIDELINES
- 2.13. SUMMARY
-
3. Objects and Types
- 3.1. CLASSES AND STRUCTS
-
3.2. CLASSES
- 3.2.1. Data Members
-
3.2.2. Function Members
-
3.2.2.1. Methods
- 3.2.2.1.1. Declaring Methods
- 3.2.2.1.2. Invoking Methods
- 3.2.2.1.3. Passing Parameters to Methods
- 3.2.2.1.4. ref Parameters
- 3.2.2.1.5. out Parameters
- 3.2.2.1.6. Named Arguments
- 3.2.2.1.7. Optional Arguments
- 3.2.2.1.8. Method Overloading
- 3.2.2.1.9. Properties
- 3.2.2.1.10. Read-Only and Write-Only Properties
- 3.2.2.1.11. Access Modifiers for Properties
- 3.2.2.1.12. Auto-Implemented Properties
- 3.2.2.2. Constructors
-
3.2.2.1. Methods
- 3.2.3. readonly Fields
- 3.3. ANONYMOUS TYPES
- 3.4. STRUCTS
- 3.5. PARTIAL CLASSES
- 3.6. STATIC CLASSES
- 3.7. THE OBJECT CLASS
- 3.8. EXTENSION METHODS
- 3.9. SUMMARY
- 4. Inheritance
- 5. Generics
- 6. Arrays and Tuples
- 7. Operators and Casts
- 8. Delegates, Lambdas, and Events
- 9. Strings and Regular Expressions
- 10. Collections
-
11. Language Integrated Query
- 11.1. LINQ OVERVIEW
- 11.2. LINQ Query
-
11.3. STANDARD QUERY OPERATORS
- 11.3.1. Filtering
- 11.3.2. Filtering with Index
- 11.3.3. Type Filtering
- 11.3.4. Compound from
- 11.3.5. Sorting
- 11.3.6. Grouping
- 11.3.7. Grouping with Nested Objects
- 11.3.8. Join
- 11.3.9. Set Operations
- 11.3.10. Zip
- 11.3.11. Partitioning
- 11.3.12. Aggregate Operators
- 11.3.13. Conversion
- 11.3.14. Generation Operators
- 11.4. PARALLEL LINQ
- 11.5. EXPRESSION TREES
- 11.6. LINQ PROVIDERS
- 11.7. SUMMARY
- 12. Dynamic Language Extensions
-
13. Memory Management and Pointers
- 13.1. MEMORY MANAGEMENT UNDER THE HOOD
- 13.2. FREEING UNMANAGED RESOURCES
-
13.3. UNSAFE CODE
-
13.3.1. Accessing Memory Directly with Pointers
- 13.3.1.1. Writing Unsafe Code with the unsafe Keyword
- 13.3.1.2. Pointer Syntax
- 13.3.1.3. Casting Pointers to Integer Types
- 13.3.1.4. Casting Between Pointer Types
- 13.3.1.5. void Pointers
- 13.3.1.6. Pointer Arithmetic
- 13.3.1.7. The sizeof Operator
- 13.3.1.8. Pointers to Structs: The Pointer Member Access Operator
- 13.3.1.9. Pointers to Class Members
- 13.3.2. Pointer Example: PointerPlayground
- 13.3.3. Using Pointers to Optimize Performance
-
13.3.1. Accessing Memory Directly with Pointers
- 13.4. SUMMARY
- 14. Reflection
-
15. Errors and Exceptions
- 15.1. EXCEPTION CLASSES
- 15.2. CATCHING EXCEPTIONS
- 15.3. USER-DEFINED EXCEPTION CLASSES
- 15.4. SUMMARY
-
1. .NET Architecture
-
II. Visual Studio
-
16. Visual Studio 2010
- 16.1. WORKING WITH VISUAL STUDIO 2010
- 16.2. REFACTORING TOOLS
- 16.3. MULTI-TARGETING THE .NET FRAMEWORK
- 16.4. WPF, WCF, WF, AND MORE
- 16.5. SUMMARY
- 17. Deployment
-
16. Visual Studio 2010
-
III. Foundation
-
18. Assemblies
- 18.1. WHAT ARE ASSEMBLIES?
- 18.2. CREATING ASSEMBLIES
- 18.3. APPLICATION DOMAINS
-
18.4. SHARED ASSEMBLIES
- 18.4.1. Strong Names
- 18.4.2. Integrity Using Strong Names
- 18.4.3. Global Assembly Cache
- 18.4.4. Creating a Shared Assembly
- 18.4.5. Create a Strong Name
- 18.4.6. Installing the Shared Assembly
- 18.4.7. Using the Shared Assembly
- 18.4.8. Delayed Signing of Assemblies
- 18.4.9. References
- 18.4.10. Native Image Generator
- 18.5. CONFIGURING .NET APPLICATIONS
- 18.6. VERSIONING
- 18.7. SUMMARY
- 19. Instrumentation
- 20. Threads, Tasks, and Synchronization
- 21. Security
- 22. Localization
- 23. System.Transactions
-
24. Networking
- 24.1. THE WEBCLIENT CLASS
- 24.2. WEBREQUEST AND WEBRESPONSE CLASSES
-
24.3. DISPLAYING OUTPUT AS AN HTML PAGE
- 24.3.1. Allowing Simple Web Browsing from Your Applications
- 24.3.2. Launching Internet Explorer Instances
- 24.3.3. Giving Your Application More IE-Type Features
- 24.3.4. Printing Using the WebBrowser Control
- 24.3.5. Displaying the Code of a Requested Page
- 24.3.6. The WebRequest and WebResponse Classes Hierarchy
- 24.4. UTILITY CLASSES
- 24.5. LOWER-LEVEL PROTOCOLS
- 24.6. SUMMARY
-
25. Windows Services
- 25.1. WHAT IS A WINDOWS SERVICE?
- 25.2. WINDOWS SERVICES ARCHITECTURE
- 25.3. CREATING A WINDOWS SERVICE PROGRAM
- 25.4. MONITORING AND CONTROLLING WINDOWS SERVICES
- 25.5. TROUBLESHOOTING AND EVENT LOGGING
- 25.6. SUMMARY
-
26. Interop
- 26.1. .NET AND COM
- 26.2. USING A COM COMPONENT FROM A .NET CLIENT
- 26.3. USING A .NET COMPONENT FROM A COM CLIENT
- 26.4. PLATFORM INVOKE
- 26.5. SUMMARY
- 27. Core XAML
- 28. Managed Extensibility Framework
-
29. Manipulating Files and the Registry
- 29.1. MANAGING THE FILE SYSTEM
- 29.2. MOVING, COPYING, AND DELETING FILES
- 29.3. READING AND WRITING TO FILES
- 29.4. MAPPED-MEMORY FILES
- 29.5. READING DRIVE INFORMATION
- 29.6. FILE SECURITY
- 29.7. READING AND WRITING TO THE REGISTRY
- 29.8. READING AND WRITING TO ISOLATED STORAGE
- 29.9. SUMMARY
-
18. Assemblies
-
IV. Data
-
30. Core ADO.NET
- 30.1. ADO.NET OVERVIEW
- 30.2. USING DATABASE CONNECTIONS
- 30.3. COMMANDS
- 30.4. FAST DATA ACCESS: THE DATA READER
- 30.5. MANAGING DATA AND RELATIONSHIPS: THE DATASET CLASS
- 30.6. XML SCHEMAS: GENERATING CODE WITH XSD
- 30.7. POPULATING A DATASET
- 30.8. PERSISTING DATASET CHANGES
- 30.9. WORKING WITH ADO.NET
- 30.10. SUMMARY
- 31. ADO.NET Entity Framework
- 32. Data Services
-
33. Manipulating XML
- 33.1. XML STANDARDS SUPPORT IN .NET
- 33.2. INTRODUCING THE SYSTEM.XML NAMESPACE
- 33.3. USING SYSTEM.XML CLASSES
- 33.4. READING AND WRITING STREAMED XML
- 33.5. USING THE DOM IN .NET
- 33.6. USING XPATHNAVIGATORS
- 33.7. XML AND ADO.NET
- 33.8. SERIALIZING OBJECTS IN XML
- 33.9. LINQ TO XML AND .NET
- 33.10. WORKING WITH DIFFERENT XML OBJECTS
- 33.11. USING LINQ TO QUERY XML DOCUMENTS
- 33.12. MORE QUERY TECHNIQUES FOR XML DOCUMENTS
- 33.13. SUMMARY
- 34. .NET Programming with SQL Server
-
30. Core ADO.NET
-
V. Presentation
- 35. Core WPF
-
36. Business Applications with WPF
-
36.1. DATA BINDING
- 36.1.1. BooksDemo Application
- 36.1.2. Binding with XAML
- 36.1.3. Simple Object Binding
- 36.1.4. Change Notification
- 36.1.5. Object Data Provider
- 36.1.6. List Binding
- 36.1.7. Master Details Binding
- 36.1.8. MultiBinding
- 36.1.9. Priority Binding
- 36.1.10. Value Conversion
- 36.1.11. Adding List Items Dynamically
- 36.1.12. Data Template Selector
- 36.1.13. Binding to XML
- 36.1.14. Binding Validation
- 36.2. COMMANDING
- 36.3. TREEVIEW
- 36.4. DATAGRID
- 36.5. SUMMARY
-
36.1. DATA BINDING
- 37. Creating Documents with WPF
- 38. Silverlight
-
39. Windows Forms
- 39.1. CREATING A WINDOWS FORMS APPLICATION
- 39.2. CONTROL CLASS
-
39.3. STANDARD CONTROLS AND COMPONENTS
- 39.3.1. Button
- 39.3.2. CheckBox
- 39.3.3. RadioButton
- 39.3.4. ComboBox, ListBox, and CheckedListBox
- 39.3.5. The DataGridView Control
- 39.3.6. DateTimePicker
- 39.3.7. ErrorProvider
- 39.3.8. ImageList
- 39.3.9. Label
- 39.3.10. ListView
- 39.3.11. PictureBox
- 39.3.12. ProgressBar
- 39.3.13. TextBox, RichTextBox, and MaskedTextBox
- 39.3.14. Panel
- 39.3.15. FlowLayoutPanel and TableLayoutPanel
- 39.3.16. SplitContainer
- 39.3.17. TabControl and TabPages
- 39.3.18. ToolStrip
- 39.3.19. MenuStrip
- 39.3.20. ContextMenuStrip
- 39.3.21. ToolStripMenuItem
- 39.3.22. ToolStripManager
- 39.3.23. ToolStripContainer
- 39.4. FORMS
- 39.5. SUMMARY
-
40. Core ASP.NET
- 40.1. ASP.NET INTRODUCTION
- 40.2. ASP.NET WEB FORMS
- 40.3. ADO.NET AND DATA BINDING
- 40.4. APPLICATION CONFIGURATION
- 40.5. SUMMARY
-
41. ASP.NET Features
- 41.1. USER AND CUSTOM CONTROLS
- 41.2. MASTER PAGES
- 41.3. SITE NAVIGATION
- 41.4. SECURITY
- 41.5. THEMES
- 41.6. WEB PARTS
- 41.7. ASP.NET AJAX
-
41.8. WHAT IS AJAX?
- 41.8.1. What Is ASP.NET AJAX?
- 41.8.2. ASP.NET AJAX Web Site Example
- 41.8.3. ASP.NET AJAX-Enabled Web Site Configuration
- 41.8.4. Adding ASP.NET AJAX Functionality
-
41.8.5. Using the AJAX Library
- 41.8.5.1. Adding JavaScript to a Web Page
- 41.8.5.2. Global Utility Functions
- 41.8.5.3. Using the AJAX Library JavaScript OOP Extensions
- 41.8.5.4. The PageRequestManager and Application Objects
- 41.8.5.5. JavaScript Debugging
- 41.8.5.6. Making Asynchronous Web Method Calls
- 41.8.5.7. ASP.NET Application Services
- 41.9. SUMMARY
-
42. ASP.NET Dynamic Data and MVC
- 42.1. ROUTING
- 42.2. DYNAMIC DATA
- 42.3. MVC
- 42.4. SUMMARY
-
VI. Communication
- 43. Windows Communication Foundation
- 44. Windows Workflow Foundation 4
- 45. Peer-to-Peer Networking
-
46. Message Queuing
- 46.1. OVERVIEW
- 46.2. MESSAGE QUEUING PRODUCTS
- 46.3. MESSAGE QUEUING ARCHITECTURE
- 46.4. MESSAGE QUEUING ADMINISTRATIVE TOOLS
- 46.5. PROGRAMMING MESSAGE QUEUING
- 46.6. COURSE ORDER APPLICATION
- 46.7. RECEIVING RESULTS
- 46.8. TRANSACTIONAL QUEUES
- 46.9. MESSAGE QUEUING WITH WCF
- 46.10. MESSAGE QUEUE INSTALLATION
- 46.11. SUMMARY
- 47. Syndication
-
48. Graphics with GDI+
- 48.1. UNDERSTANDING DRAWING PRINCIPLES
- 48.2. MEASURING COORDINATES AND AREAS
- 48.3. DRAWING SCROLLABLE WINDOWS
- 48.4. WORLD, PAGE, AND DEVICE COORDINATES
- 48.5. COLORS
- 48.6. PENS AND BRUSHES
- 48.7. DRAWING SHAPES AND LINES
- 48.8. DISPLAYING IMAGES
- 48.9. ISSUES WHEN MANIPULATING IMAGES
- 48.10. DRAWING TEXT
- 48.11. SIMPLE TEXT EXAMPLE
- 48.12. FONTS AND FONT FAMILIES
- 48.13. ENUMERATING FONT FAMILIES EXAMPLE
- 48.14. EDITING A TEXT DOCUMENT: THE CAPSEDITOR EXAMPLE
- 48.15. PRINTING
- 48.16. SUMMARY
- 49. Visual Studio Tools for Office
- 50. Managed Add-In Framework
- 51. Enterprise Services
-
52. Directory Services
- 52.1. THE ARCHITECTURE OF ACTIVE DIRECTORY
- 52.2. ADMINISTRATION TOOLS FOR ACTIVE DIRECTORY
-
52.3. PROGRAMMING ACTIVE DIRECTORY
- 52.3.1. Classes in System.DirectoryServices
- 52.3.2. Binding to Directory Services
- 52.3.3. Cache
- 52.3.4. Creating New Objects
- 52.3.5. Updating Directory Entries
- 52.3.6. Accessing Native ADSI Objects
- 52.3.7. Searching in Active Directory
- 52.4. SEARCHING FOR USER OBJECTS
- 52.5. ACCOUNT MANAGEMENT
- 52.6. DSML
- 52.7. SUMMARY
-
53. C#, Visual Basic, C++/CLI, and F#
- 53.1. NAMESPACES
- 53.2. DEFINING TYPES
- 53.3. METHODS
- 53.4. STATIC MEMBERS
- 53.5. ARRAYS
- 53.6. CONTROL STATEMENTS
- 53.7. LOOPS
- 53.8. EXCEPTION HANDLING
- 53.9. INHERITANCE
- 53.10. RESOURCE MANAGEMENT
- 53.11. DELEGATES
- 53.12. EVENTS
- 53.13. GENERICS
- 53.14. LINQ QUERIES
- 53.15. C++/CLI MIXING NATIVE AND MANAGED CODE
- 53.16. C# SPECIFICS
- 53.17. SUMMARY
-
54. .NET Remoting
- 54.1. WHY USE .NET REMOTING?
- 54.2. .NET REMOTING TERMS EXPLAINED
- 54.3. CONTEXTS
- 54.4. REMOTE OBJECTS, CLIENTS, AND SERVERS
- 54.5. .NET REMOTING ARCHITECTURE
-
54.6. CONFIGURATION FILES
- 54.6.1. Server Configuration for Well-Known Objects
- 54.6.2. Client Configuration for Well-Known Objects
- 54.6.3. Server Configuration for Client-Activated Objects
- 54.6.4. Client Configuration for Client-Activated Objects
- 54.6.5. Client Code Using Configuration Files
- 54.6.6. Delayed Loading of Client Channels
- 54.6.7. Debugging Configuration
- 54.6.8. Lifetime Services in Configuration Files
- 54.6.9. Formatter Providers
- 54.7. HOSTING SERVERS IN ASP.NET
- 54.8. CLASSES, INTERFACES, AND SOAPSUDS
- 54.9. ASYNCHRONOUS REMOTING
- 54.10. SECURITY WITH .NET REMOTING
- 54.11. REMOTING AND EVENTS
- 54.12. CALL CONTEXTS
- 54.13. SUMMARY
- 55. Web Services with ASP.NET
- 56. LINQ to SQL
- 57. Windows Workflow Foundation 3.0
- A. Guidelines for Windows 7 and Windows Server 2008 R2
Product information
- Title: Professional C# 4 and .NET 4
- Author(s):
- Release date: March 2010
- Publisher(s): Wrox
- ISBN: 9780470502259
You might also like
book
Professional C# 2012 and .NET 4.5
Intermediate to advanced technique coverage, updated for C# 2012 and .NET 4.5 This guide is geared …
book
Professional C# 5.0 and .NET 4.5.1
Comprehensive, advanced coverage of C# 5.0 and .NET 4.5.1 Whether you're a C# guru or transitioning …
book
C# 6.0 and the .NET 4.6 Framework, Seventh Edition
This new 7th edition of Pro C# 6.0 and the .NET 4.6 Platform has been completely …
book
Essential C# 3.0: For .NET Framework 3.5
is an extremely well-written and well-organized “no-fluff” guide to C# 3.0, which will appeal to programmers …