C# 7.0 in a Nutshell
by Joseph Albahari and Ben Albahari
Copyright © 2018 Joseph Albahari, Ben Albahari.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
Online editions are available for most titles (http://oreilly.com/safari).
目录
1. Introducing C# and the .NET Framework
- Object Orientation
- Type Safety
- Memory Management
- Platform Support
- C# and the CLR
- The CLR and .NET Framework
- Other Frameworks
- A Brief History of C#
2. C# Language Basics
- 第一个C#程序
- 语法
- 类型基础
- 数字类型
- Boolean类型和运算符
- 字符串和字符
- 数组——多维数组;var
- 变量和形参
- 表达式和运算符
- null运算符
- 语句
- 命名空间
3. Creating Types in C#
- 类——表达式体方法;属性;解构器;索引器;部分类型;nameof
- Inheritance
- The object Type
- Structs
- Access Modifiers
- Interfaces
- Enums
- Nested Types
- Generics
4. Advanced C#
- 委托——多播委托;泛型委托
- Events
- Lambda Expressions
- Anonymous Methods
- try Statements and Exceptions
- Enumeration and Iterators
- Nullable Types
- Extension Methods
- Anonymous Types
- Tuples (C# 7)
- Attributes
- Caller Info Attributes
- Dynamic Binding
- Operator Overloading
- Unsafe Code and Pointers
- Preprocessor Directives
- XML Documentation
5. Framework Overview
- .NET Standard 2.0
- The CLR and Core Framework
- Applied Technologies
6. Framework Fundamentals
- String and Text Handling
- Dates and Times
- Dates and Time Zones
- Formatting and Parsing
- Standard Format Strings and Parsing Flags
- Other Conversion Mechanisms
- Globalization
- Working with Numbers
- Enums
- The Guid Struct
- Equality Comparison
- Order Comparison
- Utility Classes
7. Collections
- Enumeration
- The ICollection and IList Interfaces
- The Array Class
- Lists, Queues, Stacks, and Sets
- Dictionaries
- Customizable Collections and Proxies
- Plugging in Equality and Order
8. LINQ Queries
- Getting Started
- Fluent Syntax
- Query Expressions
- Deferred Execution
- Subqueries
- Composition Strategies
- Projection Strategies
- Interpreted Queries
- LINQ to SQL and Entity Framework
- Building Query Expressions
9. LINQ Operators
- Overview
- Filtering
- Projecting
- Joining
- Ordering
- Grouping
- Set Operators
- Conversion Methods
- Element Operators
- Aggregation Methods
- Quantifiers
- Generation Methods
10. LINQ to XML
- Architectural Overview
- X-DOM Overview
- Instantiating an X-DOM
- Navigating and Querying
- Updating an X-DOM
- Working with Values
- Documents and Declarations
- Names and Namespaces
- Annotations
- Projecting into an X-DOM
11. Other XML Technologies
- XmlReader
- XmlWriter
- Patterns for Using XmlReader/XmlWriter
- XSD and Schema Validation
- XSLT
12. Disposal and Garbage Collection
- IDisposable, Dispose, and Close
- Automatic Garbage Collection
- Finalizers
- How the Garbage Collector Works
- Managed Memory Leaks
- Weak References
13. Diagnostics
- Conditional Compilation
- Debug and Trace Classes
- Debugger Integration
- Processes and Process Threads
- StackTrace and StackFrame
- Windows Event Logs
- Performance Counters
- The Stopwatch Class
14. Concurrency and Asynchrony
- Introduction
- Threading
- Tasks
- Principles of Asynchrony
- Asynchronous Functions in C#
- Asynchronous Patterns
- Obsolete Patterns
15. Streams and I/O
- Stream Architecture
- Using Streams
- Stream Adapters
- Compression Streams
- Working with ZIP Files
- File and Directory Operations
- File I/O in UWP
- Memory-Mapped Files
- Isolated Storage
16. Networking
- Network Architecture
- Addresses and Ports
- URIs
- Client-Side Classes
- Working with HTTP
- Writing an HTTP Server
- Using FTP
- Using DNS
- Sending Mail with SmtpClient
- Using TCP
- Receiving POP3 Mail with TCP
- TCP in Windows Runtime
17. Serialization
- Serialization Concepts
- The Data Contract Serializer
- Data Contracts and Collections
- Extending Data Contracts
- The Binary Serializer
- Binary Serialization Attributes
- Binary Serialization with ISerializable
- XML Serialization
18. Assemblies
- What’s in an Assembly
- Strong Names and Assembly Signing
- Assembly Names
- Authenticode Signing
- The Global Assembly Cache
- Resources and Satellite Assemblies
- Resolving and Loading Assemblies
- Deploying Assemblies Outside the Base Folder
- Packing a Single-File Executable
- Working with Unreferenced Assemblies
19. Reflection and Metadata
- Reflecting and Activating Types
- Reflecting and Invoking Members
- Reflecting Assemblies
- Working with Attributes
- Dynamic Code Generation
- Emitting Assemblies and Types
- Emitting Type Members
- Emitting Generic Methods and Types
- Awkward Emission Targets
- Parsing IL
20. Dynamic Programming
- The Dynamic Language Runtime
- Numeric Type Unification
- Dynamic Member Overload Resolution
- Implementing Dynamic Objects
- Interoperating with Dynamic Languages
21. Security
- Code Access Security
- Identity and Role Security
- Operating System Security
- Cryptography Overview
- Windows Data Protection
- Hashing
- Symmetric Encryption
- Public Key Encryption and Signing
22. Advanced Threading
- Synchronization Overview
- Exclusive Locking
- Locking and Thread Safety
- Nonexclusive Locking
- Signaling with Event Wait Handles
- The Barrier Class
- Lazy Initialization
- Thread-Local Storage
- Interrupt and Abort
- Suspend and Resume
- Timers
23. Parallel Programming
- Why PFX?
- PLINQ
- The Parallel Class
- Task Parallelism
- Working with AggregateException
- Concurrent Collections
- BlockingCollection<T>
24. Application Domains
- Application Domain Architecture
- Creating and Destroying Application Domains
- Using Multiple Application Domains
- Using DoCallBack
- Monitoring Application Domains
- Domains and Threads
- Sharing Data Between Domains
25. Native and COM Interoperability
- Calling into Native DLLs
- Type Marshaling
- Callbacks from Unmanaged Code
- Simulating a C Union
- Shared Memory
- Mapping a Struct to Unmanaged Memory
- COM Interoperability
- Calling a COM Component from C#
- Embedding Interop Types
- Primary Interop Assemblies
- Exposing C# Objects to COM
26. Regular Expressions
- Regular Expression Basics
- Quantifiers
- Zero-Width Assertions
- Groups
- Replacing and Splitting Text
- Cookbook Regular Expressions
- Regular Expressions Language Reference
27. The Roslyn Compiler
- Roslyn Architecture
- Syntax Trees
- Compilations and Semantic Models