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