分享
 
 
 

Essential C#2.0(英文版)

Essential C#2.0(英文版)  点此进入淘宝搜索页搜索
  特别声明:本站仅为商品信息简介,并不出售商品,您可点击文中链接进入淘宝网搜索页搜索该商品,有任何问题请与具体淘宝商家联系。
  參考價格: 点此进入淘宝搜索页搜索
  分類: 图书,计算机/网络,程序设计,其他,

作者: Mark Michaelis著

出 版 社: 人民邮电出版社

出版时间: 2007-12-1字数: 1056000版次: 1页数: 720印刷时间: 2007/12/01开本: 16开印次: 1纸张: 胶版纸I S B N : 9787115166876包装: 精装内容简介

本书以大量实例,详尽地阐述了C# 2.0的核心特性,指导方针和最佳实践。书中代码采用了专门的格式,并采用 “知识地图”的形式概括出每一章的主要内容。

本书全面讲解了C#语言,读者从中能够学到:C#基本数据类型、值类型、引用类型、类型转换和数组;运算符、控制流、循环、条件逻辑和顺序编程;方法、参数、异常处理和结构化编程;类、遗传、结构接口和面向对象编程;结构良好的类型、运算符重载、命名空间和垃圾回收;泛型、集合和迭代子;映射、属性和声明性编程;线程、同步和多线程模式;互操作性和不安全代码;C#通用语言基础结构(CLI)。

本书内容全面系统,并经过精心编排,相信无论是初学编程的新手、有其他语言编程经验的开发者或是专业C#程序员,阅读本书都将受益匪浅。

目录

1Introducing C#

Hello, World

Compiling and Running the Application

Managed Execution and the Common Language Infrastructure

C# Syntax Fundamentals

C# Keywords

Type Definition

Main

Statements and Statement Delimiters

Whitespace

Working with Variables

Data Types

Declaring a Variable

Assigning a Variable

Using a Variable

Console Input and Output

Getting Input from the Console

Writing Output to the Console

Comments

Common Intermediate Language and ILDASM

2Data Types

Fundamental Numeric Types

Integer Types

Floating-Point Types (float, double)

Decimal Type

Literal Values

More Fundamental Types

Boolean Type (bool)

Character Type (char)

Strings

null and void

null

The void Nontype

Categories of Types

Value Types

Reference Types

Nullable Modifier

Conversions between Data Types

Explicit Cast

Implicit Cast

Type Conversion without Casting

Arrays

Declaring an Array

Instantiating and Assigning Arrays

Using an Array

Strings as Arrays

Common Errors

3Operators and Control Flow

Operators

Plus and Minus Unary Operators (+, -)

Arithmetic Binary Operators (+, -, *, /, %)

Parenthesis Operator

Assignment Operators (+=, -=, *=, /=, %=)

Increment and Decrement Operators (++, --)

Constant Expressions (const)

Introducing Flow Control

ifStatement

Nested if

Code Blocks ({})

Scope

Boolean Expressions

Relational and Equality Operators

Logical Boolean Operators

Logical Negation Operator (!)

Conditional Operator (?)

Bitwise Operators ( , , |, &, ^, ~)

Shift Operators ( , , =, =)

Bitwise Operators (&, |, ^)

Bitwise Assignment Operators (&=, |=, ^=)

Bitwise Complement Operator (~)

Control Flow Statements, Continued

The while and do/while Loops

The for loop

The foreach Loop

The switch Statement

Jump Statements

The break Statement

The continue Statement

The goto Statement

C# Preprocessor Directives

Excluding and Including Code (#if, #elif, #else, #endif)

Defining Preprocessor Symbols (#define, #undef)

Emitting Errors and Warnings (#error, #warning)

Turning Off Warning Messages (#pragma)

nowarn: warn list Option

Specifying Line Numbers (#line)

Hints for Visual Editors (#region, #endregion)

4Methods and Parameters

Calling a Method

Namespace

Type Name

Scope

Method Name

Parameters

Method Return

Statement versus Method Call

Declaring a Method

Parameter Declaration

Method Return Declaration

The using Directive

Aliasing

Returns and Parameters on Main()

Parameters

Value Parameters

Reference Parameters (ref)

Output Parameters (out)

Parameter Arrays (params)

Recursion

Method Overloading

Basic Error Handling with Exceptions

Trapping Errors

Reporting Errors Using a throw Statement

5Classes

Defining and Instantiating a Class

Instance Fields

Declaring an Instance Field

Accessing an Instance Field

Instance Methods

Using the this Keyword

Access Modifiers

Constructors

Declaring a Constructor

Default Constructors

Overloading Constructors

Calling Another Constructor Using this

Static

Static Fields

Static Methods

Static Constructors

Static Classes

const and readonly Modifiers

const

readonly

Properties

Declaring a Property

Naming Conventions

Static Properties

Using Properties with Validation

Read-Only and Write-Only Properties

Access Modifiers on Getters and Setters

Properties as Virtual Fields

Properties and Method Calls Not Allowed as ref or out Parameter Values

Nested Classes

Partial Classes

6Inheritance

Derivation

Casting between Base and Derived Types

Support for Parameter Covariance and Contravariance

private Access Modifier

protected Access Modifier

Single Inheritance

Sealed Classes

Overriding the Base Class

virtual Modifier

new Modifier

sealed Modifier

base Member

Constructors

Abstract Classes

Everything Ultimately Derives from System.Object

Verifying the Underlying Type with the is Operator

Conversion Using the as Operator

7Interfaces

Introducing Interfaces

Polymorphism through Interfaces

Interface Implementation

Explicit Member Implementation

Implicit Member Implementation

Explicit versus Implicit Interface Implementation

Casting between the Implementing Class and Its Interfaces

Interface Inheritance

Multiple Interface Inheritance

Implementing Multiple Inheritance via Interfaces

Versioning

Interfaces Compared with Classes

8Value Types

Structs

Initializing structs

Using the default Operator

Inheritance and Interfaces with Value Types

Boxing

Enums

Type Compatibility between Enums

Converting between Enums and Strings

Enums as Flags

9Well-Formed Types

Overriding object Members

Overriding ToString()

Overriding GetHashCode()

Overriding Equals()

Guidelines for Implementing Equality

Operator Overloading

Comparison Operators (==, !=, , , =, =)

Binary Operators (+, -, *, /, %, &, |, ^, , )

Combining Assignment with Binary Operators (+=, -=, *=, /=, %=, &=...)337

Conditional Logical Operators (&&, ||)

Unary Operators (+, -, !, ~, ++, --, true, false)

Conversion Operators

Guidelines for Conversion Operators

Referencing Other Assemblies

Changing the Assembly Target

Encapsulation of Types

Referencing an Assembly

Defining Namespaces

Namespace Alias Qualifier

XML Comments

Associating XML Comments with Programming Constructs

Generating an XML Documentation File

Garbage Collection

Weak References

Resource Cleanup

Finalizers

Deterministic Finalization with the using Statement

Garbage Collection and Finalization

Resource Utilization and Finalization Guidelines

10Exception Handling

Multiple Exception Types

Catching Exceptions

General Catch Block

Guidelines for Exception Handling

Defining Custom Exceptions

11Generics

C# without Generics

Introducing Generic Types

Using a Generic Class

Defining a Simple Generic Class

Benefits of Generics

Type Parameter Naming Guidelines

Generic Interfaces and Structs

Defining a Constructor and a Finalizer

Specifying a Default Value

Multiple Type Parameters

Nested Generic Types

Type Compatibility between Generic Classes with Type-Compatible Type Parameters

Constraints

Interface Constraints

Base Class Constraints

struct/class Constraints

Multiple Constraints

Constructor Constraints

Constraint Inheritance

Generic Methods

Type Inferencing

Specifying Constraints

Generic Internals

Instantiating Generics Based on Value Types

Instantiating Generics Based on Reference Types

12Collections

Primary Collection Classes

List Collections: List T and ArrayList

Dictionary Collections: Dictionary TKey, TValue and Hashtable

Sorted Collections: SortedDictionary TKey, TValue and SortedList T

Stack Collections: Stack T and Stack

Queue Collections: Queue T and Queue

Linked Lists: LinkedList T

Introducing Collection Class Interfaces

IList T versus IDictionary TKey, TValue

IComparable T

ICollection T

Iterating Using a foreach Loop

Providing an Index Operator

Returning Null or an Empty Collection

Iterators

Defining an Iterator

Iterator Syntax

Yielding Values from an Iterator

Iterators and State453

More Iterator Examples455

Placing ayield returnwithin a Loop

Canceling Further Iteration: yield break

Creating Multiple Iterators in a Single Class

yield Statement Characteristics

13Delegates and Events

Method Pointers

Defining the Scenario

Delegate Data Types

Delegate Internals

Defining a Delegate Type

Instantiating a Delegate

Anonymous Methods

Outer Variables

Multicast Delegates and the Observer Pattern

Coding the Observer Pattern with Delegates

Sequential Invocation

Events

Why Events?

Declaring an Event

Coding Conventions

Generics and Delegates

Customizing the Event Implementation

14Reflection and Attributes

Refiection

Accessing Metadata Using System.Type

Member Invocation

Refiection on Generic Types

Attributes

Custom Attributes

Looking for Attributes

Initializing an Attribute through a Constructor

System.AttributeUsageAttribute

Named Parameters

15Multithreading

Running and Controlling a Separate Thread

Starting a Thread

Thread Management

Passing Parameters to Threads

Thread Pooling

Unhandled Exceptions

Synchronization

Synchronization Using Monitor

Using the lock Keyword

Choosing a lock Object

Why to Avoid Locking on this and typeof(type)

Declaring Fields as volatile

Using the System.Threading.Interlocked Class

Event Notification with Multiple Threads

Synchronization Design Best Practices

More Synchronization Types

Timers

16Multithreading Patterns

Asynchronous Results Pattern

Introducing the Asynchronous Results Pattern

Passing Data to and from an Alternate Thread

Receiving Notification of Thread Completion

Passing Arbitrary State

Asynchronous Results Conclusions

Background Worker Pattern

Establishing the Pattern

Exception Handling

Windows Forms

17Platform Interoperability and Unsafe Code

Platform Invoke

Declaring External Functions

Parameter Data Types

Using ref Rather Than Pointers

Using StructLayoutAttribute for Sequential Layout

Error Handling

Using SafeHandle

Calling External Functions

Simplifying API Calls with Wrappers

Function Pointers Map to Delegates

Guidelines

Pointers and Addresses

Unsafe Code

Pointer Declaration

Assigning a Pointer

Dereferencing a Pointer

Accessing the Member of a Referent Type

18The Common Language Infrastructure

Defining the Common Language Infrastructure (CLI)

CLI Implementations

C# Compilation to Machine Code

Runtime

Garbage Collection

Garbage Collection on .NET

Type Safety

Code Access Security

Platform Portability

Performance

Application Domains

Assemblies, Manifests, and Modules

Common Intermediate Language (CIL)

Common Type System (CTS)

Common Language Specification (CLS)

Base Class Library (BCL)

Metadata

ADownloading and Installing the C# Compiler and the CLI Platform

BComplete Source Code Listings

CC# 2.0 Topics

Index

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
>>返回首頁<<
 
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有