【实例简介】C# Programming Yellow Book
Welcome to the Wonderful World of Rob Miles™. This is a world of bad jokes, puns,
and programming. In this book I'm going to give you a smattering of the C#
programming language. If you have programmed before I'd be grateful if you'd still
read the text. It is worth it just for the jokes and you may actually learn something.
and programming. In this book I'm going to give you a smattering of the C#
programming language. If you have programmed before I'd be grateful if you'd still
read the text. It is worth it just for the jokes and you may actually learn something.
【实例截图】



【核心代码】
Introduction
5
Welcome ............................................................................................................................. 5
Reading the notes................................................................................................................ 5
Getting a copy of the notes ................................................................................................. 5
1
Computers and Programs
6
1.1
Computers ............................................................................................................ 6
1.2
Programs and Programming ................................................................................. 8
1.3
Programming Languages.................................................................................... 13
1.4
C# ....................................................................................................................... 14
2
Simple Data Processing
18
2.1
A First C# Program ............................................................................................ 18
2.2
Manipulating Data .............................................................................................. 26
2.3
Writing a Program.............................................................................................. 37
3
Creating Programs
52
3.1
Methods.............................................................................................................. 52
3.2
Variables and Scope ........................................................................................... 58
3.3
Arrays................................................................................................................. 61
3.4
Exceptions and Errors......................................................................................... 66
3.5
The Switch Construction .................................................................................... 69
3.6
Using Files.......................................................................................................... 73
4
Creating Solutions
77
4.1
Our Case Study: Friendly Bank.......................................................................... 77
4.2
Enumerated Types.............................................................................................. 77
4.3
Structures............................................................................................................ 80
4.4
Objects, Structures and References .................................................................... 83
4.5
Designing With Objects ..................................................................................... 90
4.6
Static Items......................................................................................................... 95
4.7
The Construction of Objects............................................................................... 99
4.8
From Object to Component .............................................................................. 105
4.9
Inheritance ........................................................................................................ 111
4.10
Object Etiquette................................................................................................ 120
4.11
The power of strings and chars......................................................................... 125
4.12
Properties.......................................................................................................... 127
4.13
Building a Bank................................................................................................ 132
5
Advanced Programming
136
5.1
Generics and Collections.................................................................................. 136
5.2
Storing Business Objects.................................................................................. 140
5.3
Business Objects and Editing ........................................................................... 150
5.4
Threads and Threading ..................................................................................... 155
5.5
Structured Error Handling ................................................................................ 163
5.6
Program Organisation....................................................................................... 166ii
5.7
A Graphical User Interface............................................................................... 172
5.8
Debugging ........................................................................................................ 183
5.9
The End? .......................................................................................................... 186
6
Glossary of Terms
187
Abstract........................................................................................................................... 187
Accessor.......................................................................................................................... 187
Base ................................................................................................................................ 187
Call ................................................................................................................................. 187
Class ............................................................................................................................... 187
Code Reuse ..................................................................................................................... 188
Cohesion ......................................................................................................................... 188
Collection........................................................................................................................ 188
Compiler......................................................................................................................... 188
Component...................................................................................................................... 188
Constructor ..................................................................................................................... 188
Coupling ......................................................................................................................... 189
Creative Laziness............................................................................................................ 189
Declarative language ...................................................................................................... 189
Delegate .......................................................................................................................... 189
Dependency .................................................................................................................... 190
Event............................................................................................................................... 190
Exception ........................................................................................................................ 190
Functional Design Specification..................................................................................... 191
Globally Unique Identifier (GUID) ................................................................................ 191
Hierarchy ........................................................................................................................ 191
Immutable ....................................................................................................................... 191
Inheritance ...................................................................................................................... 191
Interface .......................................................................................................................... 191
Library ............................................................................................................................ 191
Machine code.................................................................................................................. 192
Member........................................................................................................................... 192
Metadata ......................................................................................................................... 192
Method............................................................................................................................ 192
Mutator ........................................................................................................................... 192
Namespace...................................................................................................................... 192
Overload ......................................................................................................................... 192
Override .......................................................................................................................... 193
Portable........................................................................................................................... 193
Private............................................................................................................................. 193
Property .......................................................................................................................... 193
Protected ......................................................................................................................... 193
Public .............................................................................................................................. 193
Reference ........................................................................................................................ 193
Signature......................................................................................................................... 194
Source file....................................................................................................................... 194
Static ............................................................................................................................... 194
Stream............................................................................................................................. 194
Structure.......................................................................................................................... 194
Subscript ......................................................................................................................... 194
Syntax Highlighting........................................................................................................ 195
Test harness .................................................................................................................... 195
This................................................................................................................................. 195
Typesafe.......................................................................................................................... 195
Unit test........................................................................................................................... 195
Value type....................................................................................................................... 196
网友评论
我要评论