| 作者 |
| [美] 马克·米凯利斯(Mark Michaelis) |
| 丛书名 |
| 经典原版书库 |
| 出版社 |
| 机械工业出版社 |
| ISBN |
| 9787190521155 |
| 简要 |
| 简介 |
| 内容简介书籍计算机书籍 ---------------------------C# 7.0本质论--------------------------- 作为历年来深受各层次开发人员欢迎的C#权威指南,本书讨论了从C# 3.0到7.0的最重要的C#特性,强调了现代编程模式,可帮助读者编写简洁、强大、健壮、安全和易于维护的C#代码。世界级C#专家Mark Michaelis对语言进行了全面而深入的探讨,提供了对关键C# 7.0增强、C# 7.0和.NET Core/.NET Standard的配合使用以及跨平台编译的专业论述。 ---------------------------C# 7.0本质论(英文版)[图书]--------------------------- 作为历年来深受各层次开发人员欢迎的C#权威指南,本书讨论了从C# 3.0到7.0的特性,强调了现代编程模式,可帮助读者编写简洁、强大、健壮、安全和易于维护的C#代码。知名C#专家Mark Michaelis对语言进行了深入的探讨,提供了对关键C# 7.0增强、C# 7.0和.NET Core/.NET Standard的配合使用以及跨平台编译的专业论述。 本书共22章。第1章是C#概述;第2章和第3章介绍C#中的数据类型;第4章讨论操作符和控制流;第5章探讨方法和参数;第6章讲解类,它是面向对象技术的核心;第7章介绍继承,其中包括继承语法的细节;第8章探讨接口;第9章和第10章分别介绍值类型和合式类型;第11章延伸讨论第5章引入的异常处理机制;第12章引入泛型;第13章讲解委托和Lambda表达式;第14章讨论事件;第15章介绍支持标准查询操作符的集合接口;第16章探讨使用查询表达式的LINQ;第17章讲解如何构建自定义集合;第18章介绍反射、特性和动态编程的方方面面;第19章涵盖多线程处理;第20章以第19章为基础,演示了线程同步的用法;第21章涵盖平台互操作性和不安全的代码;第22章讲解公共语言基础结构,并讨论C#程序与底层“运行时”及规范的关系。 |
| 目录 |
---------------------------C# 7.0本质论--------------------------- 译者序 推荐序 前言 致谢 作者简介 第1章 C#概述 / 1 1.1 Hello, World / 1 1.2 C#语法基础 / 8 1.3 使用变量 / 14 1.4 控制台输入和输出 / 17 1.5 注释 / 20 1.6 托管执行和CLI / 22 1.7 多个.NET框架 / 26 1.8 小结 / 28 第2章 数据类型 / 29 2.1 基本数值类型 / 29 2.2 更多基本类型 / 36 2.3 null和void / 46 2.4 数据类型转换 / 47 2.5 小结 / 52 第3章 更多数据类型 / 53 3.1 类型的划分 / 53 3.2 可空修饰符 / 55 3.3 元组 / 57 3.4 数组 / 62 3.5 小结 / 74 第4章 操作符和控制流程 / 75 4.1 操作符 / 75 4.2 控制流程概述 / 87 4.3 代码块({}) / 91 4.4 代码块、作用域和声明空间 / 93 4.5 布尔表达式 / 94 4.6 按位操作符(>,|,&,^,~) / 101 4.7 控制流程语句(续) / 106 4.8 跳转语句 / 115 4.9 C#预处理器指令 / 119 4.10 小结 / 124 第5章 方法和参数 / 126 5.1 方法的调用 / 127 5.2 方法的声明 / 131 5.3 using指令 / 135 5.4 Main()的返回值和参数 / 139 5.5 高级方法参数 / 141 5.6 递归 / 149 5.7 方法重载 / 152 5.8 可选参数 / 154 5.9 用异常实现基本错误处理 / 157 5.10 小结 / 168 第6章 类 / 169 6.1 类的声明和实例化 / 172 6.2 实例字段 / 174 6.3 实例方法 / 176 6.4 使用this关键字 / 177 6.5 访问修饰符 / 183 6.6 属性 / 184 6.7 构造函数 / 197 6.8 静态成员 / 205 6.9 扩展方法 / 213 6.10 封装数据 / 214 6.11 嵌套类 / 216 6.12 分部类 / 218 6.13 小结 / 222 第7章 继承 / 223 7.1 派生 / 224 7.2 重写基类 / 232 7.3 抽象类 / 242 7.4 所有类都从System.Object派生 / 246 7.5 使用is操作符验证基础类型 / 247 7.6 用is操作符进行模式匹配 / 248 7.7 switch语句中的模式匹配 / 248 7.8 使用as操作符进行转换 / 250 7.9 小结 / 251 第8章 接口 / 252 8.1 接口概述 / 253 8.2 通过接口实现多态性 / 254 8.3 接口实现 / 258 8.4 在实现类和接口之间转换 / 262 8.5 接口继承 / 263 8.6 多接口继承 / 265 8.7 接口上的扩展方法 / 265 8.8 通过接口实现多继承 / 266 8.9 版本控制 / 269 8.10 比较接口和类 / 270 8.11 比较接口和特性 / 271 8.12 小结 / 271 第9章 值类型 / 272 9.1 结构 / 275 9.2 装箱 / 279 9.3 枚举 / 285 9.4 小结 / 293 第10章 合式类型 / 295 10.1 重写object的成员 / 295 10.2 操作符重载 / 305 10.3 引用其他程序集 / 311 10.4 定义命名空间 / 318 10.5 XML注释 / 320 10.6 垃圾回收 / 323 10.7 资源清理 / 325 10.8 推迟初始化 / 332 10.9 小结 / 333 第11章 异常处理 / 334 11.1 多异常类型 / 334 11.2 捕捉异常 / 336 11.3 常规catch块 / 339 11.4 异常处理规范 / 341 11.5 自定义异常 / 343 11.6 重新抛出包装的异常 / 346 11.7 小结 / 349 第12章 泛型 / 350 12.1 如果C#没有泛型 / 350 12.2 泛型类型概述 / 355 12.3 约束 / 364 12.4 泛型方法 / 374 12.5 协变性和逆变性 / 377 12.6 泛型的内部机制 / 382 12.7 小结 / 385 第13章 委托和Lambda表达式 / 386 13.1 委托概述 / 387 13.2 声明委托类型 / 390 13.3 Lambda表达式 / 396 13.4 匿名方法 / 401 13.5 小结 / 413 第14章 事件 / 414 14.1 使用多播委托编码Publish-Subscribe模式 / 415 14.2 理解事件 / 426 14.3 小结 / 435 第15章 支持标准查询操作符的集合接口 / 436 15.1 集合初始化器 / 437 15.2 IEnumerable使类成为集合 / 439 15.3 标准查询操作符 / 444 15.4 匿名类型之于LINQ / 470 15.5 小结 / 477 第16章 使用查询表达式的LINQ / 478 16.1 查询表达式概述 / 478 16.2 查询表达式只是方法调用 / 493 16.3 小结 / 494 第17章 构建自定义集合 / 496 17.1 更多集合接口 / 497 17.2 主要集合类 / 498 17.3 提供索引器 / 512 17.4 返回null或者空集合 / 515 17.5 迭代器 / 515 17.6 小结 / 527 第18章 反射、特性和动态编程 / 528 18.1 反射 / 528 18.2 特性 / 539 18.3 使用动态对象进行编程 / 557 18.4 小结 / 565 第19章 多线程处理 / 566 19.1 多线程处理基础 / 568 19.2 使用System.Threading / 572 19.3 异步任务 / 577 19.4 取消任务 / 591 19.5 基于任务的异步模式 / 596 19.6 并行迭代 / 618 19.7 并行执行LINQ查询 / 626 19.8 小结 / 630 第20章 线程同步 / 631 20.1 线程同步的意义 / 632 20.2 计时器 / 653 20.3 小结 / 655 第21章 平台互操作性和不安全代码 / 656 21.1 平台调用 / 657 21.2 指针和地址 / 667 21.3 通过委托执行不安全代码 / 674 21.4 小结 / 676 第22章 公共语言基础结构 / 677 22.1 CLI的定义 / 677 22.2 CLI的实现 / 678 22.3 .NET Standard / 680 22.4 BCL / 681 22.5 将C#编译成机器码 / 681 22.6 运行时 / 682 22.7 程序集、清单和模块 / 685 22.8 公共中间语言 / 687 22.9 公共类型系统 / 687 22.10 公共语言规范 / 688 22.11 元数据 / 688 22.12 .NET Native和AOT编译 / 689 22.13 小结 / 689 ---------------------------C# 7.0本质论(英文版)[图书]--------------------------- 第1章 C#概述 1 1.1 Hello, World 2 1.2 C#语法基础 11 1.3 使用变量 20 1.4 控制台输入和输出 24 1.5 注释 28 1.6 托管执行和CLI 32 1.7 多个.NET框架 37 第2章 数据类型 43 2.1 基本数值类型 44 2.2 更多基本类型 53 2.3 null和void 67 2.4 数据类型转换 69 第3章 更多数据类型 77 3.1 类型的划分 77 3.2 可空修饰符 80 3.3 元组 83 3.4 数组 90 第4章 操作符和控制流程 109 4.1 操作符 110 4.2 控制流程概述 126 4.3 代码块 132 4.4 代码块、作用域和声明空间 135 4.5 布尔表达式 137 4.6 按位操作符 147 4.7 控制流程语句(续) 153 4.8 跳转语句 165 4.9 C#预处理器指令 171 第5章 方法和参数 181 5.1 调用方法 182 5.2 声明方法 189 5.3 using指令 195 5.4 Main()的返回值和参数 200 5.5 高级方法参数 203 5.6 递归 215 5.7 方法重载 217 5.8 可选参数 220 5.9 用异常实现基本错误处理 225 第6章 类 241 6.1 类的声明和实例化 245 6.2 实例字段 249 6.3 实例方法 251 6.4 使用this关键字 252 6.5 访问修饰符 259 6.6 属性 261 6.7 构造函数 278 6.8 静态成员 289 6.9 扩展方法 299 6.10 封装数据 301 6.11 嵌套类 304 6.12 分部类 307 第7章 继承 313 7.1 派生 314 7.2 重写基类 326 7.3 抽象类 338 7.4 所有类都从System.Object派生 344 7.5 使用is操作符验证基础类型 345 7.6 使用is操作符进行模式匹配 346 7.7 switch语句中的模式匹配 347 7.8 使用as操作符进行转换 349 第8章 接口 353 8.1 接口概述 354 8.2 通过接口实现多态性 355 8.3 接口实现 360 8.4 在实现类和接口之间转换 366 8.5 接口继承 366 8.6 多接口继承 369 8.7 接口上的扩展方法 369 8.8 通过接口实现多继承 371 8.9 版本控制 374 8.10 比较接口和类 375 8.11 比较接口和特性 377 第9章 值类型 379 9.1 结构 383 9.2 装箱 390 9.3 枚举 398 第10章 合式类型 411 10.1 重写object的成员 411 10.2 操作符重载 424 10.3 引用其他程序集 432 10.4 定义命名空间 442 10.5 XML注释 445 10.6 垃圾回收 449 10.7 资源清理 452 10.8 推迟初始化 461 第11章 异常处理 465 11.1 多异常类型 465 11.2 捕捉异常 469 11.3 常规catch块 473 11.4 异常处理规范 475 11.5 自定义异常 479 11.6 重新抛出包装的异常 483 第12章 泛型 487 12.1 如果C#没有泛型 488 12.2 泛型类型概述 493 12.3 约束 506 12.4 泛型方法 519 12.5 协变性和逆变性 524 12.6 泛型的内部机制 531 第13章 委托和Lambda表达式 537 13.1 委托概述 538 13.2 声明委托类型 542 13.3 Lambda表达式 550 13.4 匿名方法 556 第14章 事件 575 14.1 使用多播委托编码Publish-Subscribe模式 576 14.2 理解事件 591 第15章 支持标准查询操作符的集合接口 603 15.1 集合初始化器 604 15.2 IEnumerable使类成为集合 607 15.3 标准查询操作符 613 15.4 匿名类型之于LINQ 646 第16章 使用查询表达式的LINQ 657 16.1 查询表达式概述 658 16.2 查询表达式只是方法调用 676 第17章 构建自定义集合 679 17.1 更多集合接口 680 17.2 主要集合类 683 17.3 提供索引器 702 17.4 返回null或者空集合 705 17.5 迭代器 705 第18章 反射、特性和动态编程 721 18.1 反射 722 18.2 特性 735 18.3 使用动态对象进行编程 759 第19章 多线程处理 771 19.1 多线程处理基础 774 19.2 使用System.Threading 781 19.3 异步任务 789 19.4 取消任务 810 19.5 基于任务的异步模式 816 19.6 并行迭代 846 19.7 并行执行LINQ查询 856 第20章 线程同步 863 20.1 线程同步的意义 864 20.2 计时器 893 第21章 平台互操作性和不安全代码 897 21.1 平台调用 898 21.2 指针和地址 910 21.3 通过委托执行不安全代码 920 第22章 公共语言基础结构(CLI) 923 22.1 CLI的定义 924 22.2 CLI的实现 925 22.3 .NET标准 928 22.4 BCL 929 22.5 C#编译成机器码 929 22.6 运行时 932 22.7 程序集、清单和模块 936 22.8 公共中间语言 939 22.9 公共类型系统 939 22.10 公共语言规范 940 22.11 元数据 941 22.12 NET Native和AOT编译 942 Contents 1 Introducing C# 1 Hello, World 2 C# Syntax Fundamentals 11 Working with Variables 20 Console Input and Output 24 Commne ts 28 Managed Execution and the Common Language Infrastructure 32 Multiple .NET Frameworks 37 2 Data Types 43Fundamental Numeric Types 44 More Fundamental Types 53 null and void 67 Conversions between Data Types 69 3 More with Data Types 77 Categories of Types 77 Nullable Modifier 80 Tuples 83 Arrays 90 4 Operators and Control Flow 109 Operators 110 Introducing Flow Control 126 Code Blocks ({}) 132 Code Blocks, Scopes, and Declaration Spaces 135 Boolean Expressions 137 Bitwise Operators (>, |, &, ^, ~) 147 Control Flow Statements, Continued 153 Jump Statements 165 C# Preprocessor Directives 171 5 Methods and Parameters 181 Calling a Method 182 Declaring a Method 189 The using Directive 195 Returns and Parameters on Main() 200 Advanced Method Parameters 203 Recursion 215 Method Overloading 217 Optional Parameters 220 Basic Error Handling with Exceptions 225 6 Classes 241 Declaring and Instantiating a Class 245 Instance Fields 249 Instance Methods 251 Using the this Keyword 252 Access Modifiers 259 Properties 261 Constructors 278 Static Members 289 Extension Methods 299 Encapsulating the Data 301 Nested Classes 304 Partial Classes 307 7 Inheritance 313 Derivation 314 Overriding the Base Class 326 Abstract Classes 338 All Classes Derive from System.Object 344 Verifying the Underlying Type with the is Operator 345 Pattern Matching with the is Operator 346 Pattern Matching within a switch Statement 347 Conversion Using the as Operator 349 8 Interfaces 353 Introducing Interfaces 354 Polymorphism through Interfaces 355 Interface Implementation 360 Converting between the Implementing Class and Its Interfaces 366 Interface Inheritance 366 Multiple Interface Inheritance 369 Extension Methods on Interfaces 369 Implementing Multiple Inheritance via Interfaces 371 Versioning 374 Interfaces Compared with Classes 375 Interfaces Compared with Attributes 377 9 Value Types 379 Structs 383 Boxing 390 Enums 398 10 Well-Formed Types 411 Overriding object Members 411 Operator Overloading 424 Referencing Other Assemblies 432 Defining Namespaces 442 XML Comments 445 Garbage Collection 449 Resource Cleanup 452 Lazy Initialization 461 11 Exception Handling 465 Multiple Exception Types 465 Catching Exceptions 469 General Catch Block 473 Guidelines for Exception Handling 475 Defining Custom Exceptions 479 Rethrowing a Wrapped Exception 483 12 Generics 487 C# without Generics 488 Introducing Generic Types 493 Constraints 506 Generic Methods 519 Covariance and Contravariance 524 Generic Internals 531 13 Delegates and Lambda Expressions 537 Introducing Delegates 538 Declaring Delegate Types 542 Lambda Expressions 550 Anonymous Methods 556 14 Events 575 Coding the Publish-Subscribe Pattern with Multicast Delegates 576 Understanding Events 591 15 Collection Interfaces with Standard Query Operators 603 Collection Initializers 604 What Makes a Class a Collection: IEnumerable 607 Standard Query Operators 613 Anonymous Types with LINQ 646 16 LINQ with Query Expressions 657 Introducing Query Expressions 658 Query Expressions Are Just Method Invocations 676 17 Building Custom Collections 679 More Collection Interfaces 680 Primary Collection Classes 683 Providing an Indexer 702 Returning Null or an Empty Collection 705 Iterators 705 18 Reflection, Attributes, and Dynamic Programming 721 Reflection 722 Attributes 735 Programming with Dynamic Objects 759 19 Multithreading 771 Multithreading Basics 774 Working with System.Threading 781 Asynchronous Tasks 789 Canceling a Task 810 The Task-based Asynchronous Pattern 816 Executing Loop Iterations in Parallel 846 Running LINQ Queries in Parallel 856 20 Thread Synchronization 863 Why Synchronization 864 Timers 893 21 Platform Interoperability and Unsafe Code 897 Platform Invoke 898 Pointers and Addresses 910 Executing Unsafe Code via a Delegate 920 22 The Common Language Infrastructure 923 Defining the Common Language Infrastructure 924 CLI Implementations 925 .NET Standard 928 Base Class Library 929 C# Compilation to Machine Code 929 Runtime 932 Assemblies, Manifests, and Modules 936 Common Intermediate Language 939 Common Type System 939 Common Language Specification 940 Metadata 941 .NET Native and Ahead of Time Compilation 942 |