2003 aw the c sharp programming language

1.3K 146 0
2003   aw   the c sharp programming language

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

• • Table of Contents Index C# Programming Language, The By Anders Hejlsberg, Scott Wiltamuth, Peter Golde Publisher : Addison Wesley Pub Date : October 29, 2003 ISBN : 0-321-15491-6 Pages : 672 C# is a simple, modern, object-oriented, and type-safe programming language that combines the high productivity of rapid application development languages with the raw power of C and C++ Written by the language's architect and design team members, The C# Programming Language is the definitive technical reference for C# Moving beyond the online documentation, the book provides the complete specification of the language along with descriptions, reference materials, and code samples from the C# design team The first part of the book opens with an introduction to the language to bring readers quickly up to speed on the concepts of C# Next follows a detailed and complete technical specification of the C# 1.0 language, as delivered in Visual Studio NET 2002 and 2003 Topics covered include Lexical Structure, Types, Variables, Conversions, Expressions, Statements, Namespaces, Exceptions, Attributes, and Unsafe Code The second part of the book provides an introduction to and technical specification of the four major new features of C# 2.0: Generics, Anonymous Methods, Iterators, and Partial Types Reference tabs and an exhaustive print index allow readers to easily navigate the text and quickly find the topics that interest them most An enhanced online index allows readers to quickly and easily search the entire text for specific topics With the recent acceptance of C# as a standard by both the International Organization for Standardization (ISO) and ECMA, understanding the C# specification has become critical The C# Programming Language is the definitive reference for programmers who want to acquire an indepth knowledge of C# • • Table of Contents Index C# Programming Language, The By Anders Hejlsberg, Scott Wiltamuth, Peter Golde Publisher : Addison Wesley Pub Date : October 29, 2003 ISBN : 0-321-15491-6 Pages : 672 Copyright Microsoft NET Development Series Preface Part I C# 1.0 Chapter 1 Introduction Section 1.1 Hello World Section 1.3 Types and Variables Section 1.5 Statements Section 1.7 Structs Section 1.9 Interfaces Section 1.11 Delegates Section 1.2 Program Structure Section 1.4 Expressions Section 1.6 Classes and Objects Section 1.8 Arrays Section 1.10 Enums Section 1.12 Attributes Chapter 2 Lexical Structure Section 2.1 Programs Section 2.3 Lexical Analysis Section 2.5 Preprocessing Directives Section 2.2 Grammars Section 2.4 Tokens Chapter 3 Basic Concepts Section 3.1 Application Startup Section 3.2 Application Termination Section 3.4 Members Section 3.6 Signatures and Overloading Section 3.8 Namespace and Type Names Section 3.10 Execution Order Section 3.3 Declarations Section 3.5 Member Access Section 3.7 Scopes Section 3.9 Automatic Memory Management Chapter 4 Types Section 4.1 Value Types Section 4.2 Reference Types Section 4.3 Boxing and Unboxing Chapter 5 Variables Section 5.1 Variable Categories Section 5.2 Default Values Section 5.4 Variable References Section 5.3 Definite Assignment Section 5.5 Atomicity of Variable References Chapter 6 Conversions Section 6.1 Implicit Conversions Section 6.2 Explicit Conversions Section 6.4 User-Defined Conversions Section 6.3 Standard Conversions Chapter 7 Expressions Section 7.1 Expression Classifications Section 7.2 Operators Section 7.4 Function Members Section 7.3 Member Lookup Section 7.5 Primary Expressions Section 7.6 Unary Operators Section 7.7 Arithmetic Operators Section 7.9 Relational and Type-Testing Operators Section 7.11 Conditional Logical Operators Section 7.13 Assignment Operators Section 7.15 Constant Expressions Section 7.8 Shift Operators Section 7.10 Logical Operators Section 7.12 Conditional Operator Section 7.14 Expression Section 7.16 Boolean Expressions Chapter 8 Statements Section 8.1 End Points and Reachability Section 8.2 Blocks Section 8.4 Labeled Statements Section 8.6 Expression Statements Section 8.8 Iteration Statements Section 8.10 The try Statement Section 8.12 The lock Statement Section 8.3 The Empty Statement Section 8.5 Declaration Statements Section 8.7 Selection Statements Section 8.9 Jump Statements Section 8.11 The checked and unchecked Statements Section 8.13 The using Statement Chapter 9 Namespaces Section 9.1 Compilation Units Section 9.2 Namespace Declarations Section 9.4 Namespace Members Section 9.3 Using Directives Section 9.5 Type Declarations Chapter 10 Classes Section 10.1 Class Declarations Section 10.2 Class Members Section 10.4 Fields Section 10.3 Constants Section 10.5 Methods Section 10.6 Properties Section 10.7 Events Section 10.8 Indexers Section 10.10 Instance Constructors Section 10.12 Destructors Section 10.9 Operators Section 10.11 Static Constructors Chapter 11 Structs Section 11.1 Struct Declarations Section 11.2 Struct Members Section 11.4 Struct Examples Section 11.3 Class and Struct Differences Chapter 12 Arrays Section 12.1 Array Types Section 12.2 Array Creation Section 12.4 Array Members Section 12.6 Array Initializers Section 12.3 Array Element Access Section 12.5 Array Covariance Chapter 13 Interfaces Section 13.1 Interface Declarations Section 13.2 Interface Members Section 13.4 Interface Implementations Section 13.3 Fully Qualified Interface Member Names Chapter 14 Enums Section 14.1 Enum Declarations Section 14.2 Enum Modifiers Section 14.4 The System.Enum Type Section 14.3 Enum Members Section 14.5 Enum Values and Operations Chapter 15 Delegates Section 15.1 Delegate Declarations Section 15.2 Delegate Instantiation Section 15.3 Delegate Invocation Chapter 16 Exceptions Section 16.1 Causes of Exceptions Section 16.2 The System.Exception Class Section 16.4 Common Exception Classes Section 16.3 How Exceptions Are Handled Chapter 17 Attributes Section 17.1 Attribute Classes Section 17.2 Attribute Specification Section 17.4 Reserved Attributes Section 17.3 Attribute Instances Section 17.5 Attributes for Interoperation Chapter 18 Unsafe Code Section 18.1 Unsafe Contexts Section 18.2 Pointer Types Section 18.4 Pointer Conversions Section 18.6 The fixed Statement Section 18.8 Dynamic Memory Allocation Section 18.3 Fixed and Moveable Variables Section 18.5 Pointers in Expressions Section 18.7 Stack Allocation Part II C# 2.0 Chapter 19 Introduction to C# 2.0 Section 19.1 Generics Section 19.2 Anonymous Methods Section 19.4 Partial Types Section 19.3 Iterators Chapter 20 Generics Section 20.1 Generic Class Declarations Section 20.2 Generic Struct Declarations Section 20.4 Generic Delegate Declarations Section 20.6 Generic Methods Section 20.8 Expressions and Statements Section 20.10 Right-Shift Grammar Changes Section 20.3 Generic Interface Declarations Section 20.5 Constructed Types Section 20.7 Constraints Section 20.9 Revised Lookup Rules Chapter 21 Anonymous Methods Section 21.1 Anonymous Method Expressions Section 21.2 Anonymous Method Signatures Section 21.3 Anonymous Method Conversions Section 21.4 Anonymous Method Blocks Section 21.5 Outer Variables Section 21.6 Anonymous Method Evaluation Section 21.7 Delegate Instance Equality Section 21.9 Method Group Conversions Section 21.8 Definite Assignment Section 21.10 Implementation Example Chapter 22 Iterators Section 22.1 Iterator Blocks Section 22.2 Enumerator Objects Section 22.4 The yield Statement Section 22.3 Enumerable Objects Section 22.5 Implementation Example Chapter 23 Partial Types Section 23.1 Partial Declarations Section 23.2 Name Binding Part III Appendixes Appendix A Documentation Comments Section A.1 Introduction Section A.2 Recommended Tags Section A.4 An Example Section A.3 Processing the Documentation File Appendix B Grammar Section B.1 Lexical Grammar Section B.2 Syntactic Grammar Section B.3 Grammar Extensions for Unsafe Code Index Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and Addison-Wesley was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals The NET logo is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries and is used under license from Microsoft Microsoft, Windows, Visual Basic, Visual C#, and Visual C++ are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A and/or other countries/regions The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers discounts on this book when ordered in quantity for special sales For more information, please contact: U.S Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside of the U.S., please contact: International Sales (317 581-3793) international@pearsontechgroup.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [R] [S] [T] [U] [V] [W] [X] [Y] tab escape sequences tag[ [See tag]] tag[c tag] tag[code tag] tag[example tag] tag[exception tag] tag[include tag] tag[list tag] tag[para tag] tag[paramref tag] tag[permission tag] tag[remarks tag] tag[seealso tag] tag[summary tag] tag[value tag] tags, documentation comments 2nd targets, specification of attributes terminal symbols grammar notation lexical grammar termination status codes, return types termination [See application termination[termination]] terminators [See line terminators[terminators]] ternary operator [See conditional operator] this instance methods structs this access and iterator blocks[this access iteration blocks] described 2nd nested types 2nd throw statement definite assignment rules described 2nd example exceptions generics tokens and preprocessing directives[tokens preprocessing directives] kinds of 2nd lexical grammar top level types, accessibility domains transformation, defined transient states, sharing between enumerators try blocks, return statements try statement and jump statements[try statememnt jump statements] definite assignment rules 2nd example generics handling exceptions 2nd transfer of control in throw statements try-catch statement defined definite assignment rules type arguments generics inference of 2nd type casts [See also dynamic type casts] example of type declarations defined described 2nd fully qualified names type declarations: delegate types enum types; interface types; nested type declarations; struct value types [See also class types] type inferences, defined type interfacing, defined type names and identical simple names[type names identical simple names] 2nd and namespaces[type names namespaces] 2nd 3rd 4th type parameters base classes boxing 2nd constraints conversions 2nd described generics 2nd member lookups parameter array methods and generics partial types properties, events, indexers, and operators type string format type testing operators described precedence of typeof operator described 2nd generics types 2nd accessibility constraints accessibility domains 2nd application domains arrays 2nd 3rd class constraints constant declarations creating new instances declared accessibility described 2nd event declarations expressions as indexer declarations objects as 2nd of integers[types integers] syntactic grammar types: classes closed types; compile-time types; constituent types; constructed types; delegate types; element type [See also attribute parameter types] instance types interfaces; nested types; open types; partial types; pointers; reference types; runtime types; Syste [See also governing types] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [R] [S] [T] [U] [V] [W] [X] [Y] uint value type default value defined ulong value type default value defined unary minus operators unary numeric promotions unary operators described 2nd 3rd 4th 5th ID string example notation overloading 2nd 3rd pointer indirection precedence of precision unary operators: logical negation operator prefix increment and decrement operators; unary minus operator; unary plus operator [See also bitwise complement operator] unary plus operators unboxing example struct types unboxing conversions defined described 2nd 3rd unchecked operators 2nd unchecked statement defined described example underlying types, enums 2nd Unicode encoding character and string processing escape sequences 2nd 3rd 4th 5th identifiers lexical grammar unified type system, defined unintended derivations, sealed modifier unmanaged types, defined unsafe code 2nd dynamic memory allocation 2nd fixed and moveable variables 2nd fixed statements 2nd grammar extensions for 2nd pointer conversions 2nd pointers in expressions 2nd stack allocation 2nd unsafe contexts 2nd unsigned integral numeric types, precision user-defined conditional logical operators user-defined conversions conversion operator declarations described 2nd user-defined explicit conversions defined evaluating user-defined implicit conversions defined evaluating user-defined operator declarations, and overloading user-defined operators argument list function members as ushort value type default value defined using alias directives compared to using namespace directives described 2nd using directive described 2nd global attributes and namespace member declarations in Hello, World program using namespace directives 2nd using statement defined definite assignment rules described 2nd example [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [R] [S] [T] [U] [V] [W] [X] [Y] value parameters default values defined described 2nd runtime processing value semantics, structs value type variables, possible contents value types array covariance described 2nd 3rd 4th value types: enum types enumeration types; simple types; specific value type [See also delegate types] values array types enums expressions as fields local constants of expressions[values expressions] of local variables[values local variables] of variables[values variables] variable initializers 2nd variables 2nd categories 2nd default values 2nd definite assignment states described 2nd expressions as kinds of references syntactic grammar values stored in variables: fields instance variables; local variables; outer variables; output parameters; parameters; reference param [See also elements] verbatim identifier, defined verbatim string literals 2nd versioning constants and static read-only fields 2nd described vertical tab escape sequence, Unicode encoding virtual accessors 2nd 3rd 4th virtual generic methods virtual methods 2nd described 2nd interface mappings void return type, termination status code volatile fields 2nd [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [R] [S] [T] [U] [V] [W] [X] [Y] warnings, hiding inherited names while statement definite assignment rules described 2nd example white space defined lexical grammar Win 32 components, attributes for interoperation words keywords reserved words [See explicit keywords] [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [R] [S] [T] [U] [V] [W] [X] [Y] XML documentation tags example 2nd [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [R] [S] [T] [U] [V] [W] [X] [Y] yield return statement, definite assignment yield statement, iterators 2nd 3rd 4th yield types, iterator blocks ... that the "Hello, World" program is stored in the file hello.cs, the program can be compiled with the Microsoft C# compiler using the command line csc hello.cs which produces an executable assembly named hello.exe The output produced by this application when it is run is... that the referenced object is a box of the correct value type, and, if the check succeeds, the value in the box is copied out C# ''s unified type system effectively means that value types can become objects "on demand." Because of the unification,... The conversions and expression operators supported by the class Constructors The actions required to initialize instances of the class or the class itself Destructors The actions to perform before instances of the class are permanently discarded

Ngày đăng: 25/03/2019, 17:11

Từ khóa liên quan

Mục lục

  • C# Programming Language, The

  • Table of Contents

  • Copyright

  • Microsoft .NET Development Series

  • Preface

  • Part I: C# 1.0

    • Chapter 1. Introduction

      • 1.1 Hello World

      • 1.2 Program Structure

      • 1.3 Types and Variables

      • 1.4 Expressions

      • 1.5 Statements

      • 1.6 Classes and Objects

      • 1.7 Structs

      • 1.8 Arrays

      • 1.9 Interfaces

      • 1.10 Enums

      • 1.11 Delegates

      • 1.12 Attributes

      • Chapter 2. Lexical Structure

        • 2.1 Programs

        • 2.2 Grammars

        • 2.3 Lexical Analysis

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan