深入浅出C#》是包含面向对象编程、C#和Visual Studio集成开发环境的一次完整学习经历。针对大脑学习的特点,本书涵盖了C# 3.0和Visual Studio 2008, 并且讲解了从垃圾收集到扩展方法再到双缓冲动画的所有内容。你将掌握C#的最热门的语法、LINQ、.NET集合数据查询、SQL数据库以及更多内容。学完本书之时,你将成为一个熟练的C#程序员,能够设计并编写大规模的应用程序。
为何本书如此与众不同?
我们认为你用来学习新概念的时间是极其宝贵的。《深入浅出C#》使用认知科学和学习理论的研究成果,为你带来多感官的学习体验,它采用了丰富、可视、适于大脑工作的形式,而不是用过多的文字使你感到昏昏欲睡。
Intro
1 Get productive with C#: Visual Applications, in 10 minutes or less
Why you should learn C#
C# and the Visual Studio IDE make 10ts of things easy
Help the CEO go paperless
Get to know your users' needs before you start building your prograJ
Here's what you're going to build
What you do in Visual Studio...
What Visual Studio does for you...
Develop the user interface
Visual Studio, behind the scenes
Add to the auto-generated code
You can already run your application
We need a database to store our information
Creating the table for the Contact List
The blanks on contact card are columns in our People table
Finish building the table
Diagram your data so your application can access it
Insert your card data into the database
Connect your form to your database objects with a data soui-ce
Add database-driven controls to your form
Good apps are intuitive to use
How to turn YOUR application into EVERYONE'S application
Give your users the application
You're NOT done: test your installation
You built a complete data-driven application
2 It's All Just Code: Under the hood
When you're doing this...
...the IDE does this
Where programs come from
The IDE helps you code
When you change things in the IDE, you're also changing your code
Anatomy of a program
Your program knows where to start
You can change your program's entry point
Two classes can be in the same namespace
Your programs use variables to work with data
C# uses familiar math symbols
Loops pertbrm an action over and over again
Time to start coding
if/else statements make decisions
Set up conditions and see if they're true
3 Objects Get Oriented: Making code make sense
How Mike thinks about his problems
How Mike's car navigation system thinks about his problems
Mike's Navigator class has methods to set and modii~y routes
Use what you've learned to build a simple application
Mike gets an idea
Mike can use objects to solve his problem
You use a class to build an object
When you create a new object from a class,
it's called an instance of that class
A better solution.., brought to you by objects!
An instance uses fields to keep track of things
Let's create some instances!
Thanks for the memory
What's on your program's mind
You can use class and method names to make your code intuitive
Give your classes a natural structure
Class diagrams help you organize your classes so they make:sense
Build a class to work with some ,guys . -
Create a project for your guys
Build a form to interact with the gays
There's an even easier way to initialize objects
A few ideas for designing intuitive classes
4 Types and References: It's 10:00. Doyou know whereyour data is? C# Lab 1: A Day at the Races
5 Encapsulation: Keepyourprivates... private
6 Inheritance: 13ur object'sJhmily tree
7 Interfaces and abstract classes: Making classes keep their promises
8 Enums and collections: Storing lots of data C# Lab 2: The Quest
9 Reading and writing fries: Save the byte array, save the world
10 Exception handling: Putting Out Fires Gets Old
11 Events and delegates: What 13ur Code Does When you're Not Looking
12 Review and preview: Knowledge, Power, and Building Cool Stuff
13 Controls and graphics: Make it pretty
14 Captain Amazing: The Death of the Object
15 LINQ:Get control of your data
C# Lab3:Invaders
Appendix i:Leftovers
Table of Contents(the real thing)
Intro
Who is this book for?
We know what you're thinking
Metacognition
Bend your brain into submission
What you need for this book
Read me
The technical review team
Acknowledgments
"如果你想要深入学习C#并且得到学习的乐趣,这就是为你准备的书。" ——Andy Parker 羽翼渐丰的C#程序员 "如果你已经对传统的C#书籍失望,你定会爱上这一本!" ——Jay Hily