Beginning VB 2008 From Novice to Professional PDF版 英文版,Beginning VB 2008 From Novice to Professional

Beginning VB 2008 From Novice to Professional
Contents
About the Author xv
About the Technical Reviewer xvii
Introduction xix
CHAPTER 1 Ready, Steady, Go! 1
Downloading and Installing the Tools 1
Downloading Visual Basic Express 2
Installing Visual Basic Express . 3
Choosing the Application Type 3
Creating Projects and Solutions 4
Creating the Windows Application 4
Viewing the Source Code . 5
Saving the Project6
Running the Windows Application 7
Making the Windows Application Say Hello8
Adding Comments to the Application 11
Navigating the User Controls of the Solution 12
Creating the Console Application 12
Adding a Console Application Project to the Solution . 12
Making the Console Application Say Hello13
Setting the Startup Project13
Running the Console Project 13
Creating the Class Library . 14
Adding a Class Library Project to the Solution . 14
Moving Functionality . 15
Defining References 15
Calling Class Library Functionality 16
Using Variables and Constants 17
Understanding How the .NET Framework Works . 19
The Important Stuff to Remember . 21
Some Things for You to Do 22
CHAPTER 2 Learning About .NET Number and Value Types 25
Focusing and Organizing Your Development 25
Organizing the Calculator26
Focusing the Calculator . 27
Implementing the Class Library . 30
Writing the Add() Method 33
Writing Code to Test the Add() Method 35
Understanding Problems with Numeric Numbers . 40
Understanding Numeric and Value Data Types 42
Understanding Value and Reference Types 42
Understanding the CLR Numeric Types 43
Finishing the Calculator . 47
The Important Stuff to Remember . 48
Some Things for You to Do 48
CHAPTER 3 Learning About String Manipulations 51
Organizing the Translation Application 51
Building the Translator Application . 52
Creating the Translator Class . 52
Translating Hello 53
Creating the Test Application . 53
Answering the Question of Responsibility 55
Investigating the String Type55
Solving the Extra Whitespace Problem. 60
Quoting Strings . 65
Character Mapping . 67
Dealing with Languages and Cultures 68
Setting Culture and Language in Windows 68
Parsing and Processing Numbers 69
Working with Cultures 72
The Important Stuff to Remember . 74
Some Things for You to Do 75
CHAPTER 4 Learning About Data Structures, Decisions,
and Loops . 77
Understanding the Depth-First Search Algorithm . 77
Implementing User-Defined Types . 81
Declaring Structures and Classes 81
Value Type Constraints81
Organizing the Search Algorithm 87
Writing the Depth-First Search Code . 89
Defining and Implementing the Data Structure . 89
Defining the Algorithm Test . 98
Implementing the Depth-First Search Algorithm. 102
Running the Depth-First Search Algorithm . 110
The Important Stuff to Remember 111
Some Things for You to Do . 112
CHAPTER 5 Learning About Visual Basic Exception Handling 115
Understanding Errors, Exceptions, and Exception Handling 115
Running the Debugger . 116
Handling Exceptions 117
Catching Exceptions . 118
Implementing Exception Handlers . 120
Safeguarding Against Stack Unwinding . 123
Filtering Exceptions . 126
Writing Exception-Safe Code 129
Writing Defensive Code 129
Using Default State 131
Processing Errors That Are Warnings. 133
The Important Stuff to Remember 133
Some Things for You to Do . 134
CHAPTER 6 Learning the Basics of
Object-Oriented Programming . 135
Understanding Currency Spreads . 136
Organizing the Currency Exchange Application 137
Writing Tests for the Currency Exchange Application 137
Getting Started with Structural Code . 138
Understanding Base Classes . 138
Understanding Inheritance. 139
Using Visual Basic Properties 141
Understanding Inheritance and Scope Modifiers 144
Handling Verification. 148
Finishing the Base Class 151
Writing the Active Trader and Hotel Trader Currency Converters . 152
Implementing ActiveCurrencyTrader . 152
Implementing HotelCurrencyTrader 155
Learning More About Preprocessor Directives, Properties, and the
MustOverride Keyword 157
More Preprocessor Directive Details . 157
More Property Scope Details . 159
The MustOverride Keyword 159
The Important Stuff to Remember 161
Some Things for You to Do . 162
CHAPTER 7 Learning About Components and Class Hierarchies 163
Understanding Some Basic Tax Concepts . 163
Organizing the Tax Application . 164
Programming Using Ideas 165
Representing Ideas Using Visual Basic Interfaces 166
Understanding How Inheritance and Components Work . 168
Implementing a Tax Engine . 173
Defining the Interfaces . 173
Implementing a Base Class Tax Engine . 174
Using Default Implementations . 178
Implementing a Base Tax Account . 180
Using the Base Functionality of the Tax Engine to Calculate Taxes . 182
Implementing a Tax Engine and Tax Account . 182
Using the Tax Engine 187
Learning More About Inheritance and Type Casting 188
More Inheritance Details 188
More Type-Casting Details 194
The Important Stuff to Remember 195
Some Things for You to Do . 195
CHAPTER 8 Learning About Component-Oriented Architecture . 197
Understanding Kernels . 197
Organizing the Lighting Application . 198
Building the Kernel . 199
Defining the Interfaces . 199
Implementing the Kernel 203
Defining the Kernel As an Interface Instead of a Class. 220
Building a Complete Application 222
Defining Some Rooms . 222
Instantiating PublicRoom and PrivateRoom. 224
Learning More About Private Classes and Object Initialization 225
Private Classes 225
Object Initialization with Nested Data Types 226
The Important Stuff to Remember 227
Some Things for You to Do . 228
CHAPTER 9 Learning About Lists, Delegates, and
Lambda Expressions 229
Managing Collections 229
Managing a Collection Before Visual Basic 2005 229
Managing a Collection After Visual Basic 2005234
Adding Numbers and Finding Maximum Values . 235
Using Delegates . 239
Declaring the Delegate 240
Implementing Methods That Match the Delegate 241
Understanding Lambda Expressions 243
Learning More About Collection Types 245
Using a Plain-Vanilla List 245
Using a Key/Value Pair List 246
Using a Stack . 246
Using a Queue . 247
The Important Stuff to Remember 247
Some Things for You to Do . 248
CHAPTER 10 Learning About Persistence249
Organizing the Lottery-Prediction System . 249
Piping Data Using a Console 250
Reading Data from the Console 250
Building a Shell 252
Implementing the TextProcessor Application . 260
Piping Binary Data . 268
Defining the Interfaces and Implementing the Shell . 270
Defining the Type . 272
Converting a Text Stream into a Binary Stream . 274
Converting a Binary Stream into a Text Stream . 275
Tweaking Serialization . 277
Performing Custom Serialization277
Declaring a Data Member As Nonserializable . 278
Separating Data Objects from Action Objects . 278
Completing Custom Types 279
Implementing GetHashCode() 279
Implementing Equals() . 282
The Important Stuff to Remember 283
Some Things for You to Do . 284
CHAPTER 11 Learning About .NET Generics 285
Why Use .NET Generics? . 285
The Theory of a Server-Side Spreadsheet . 288
Architecting a Server-Side Spreadsheet 291
Designing the Architecture 292
Defining the Server Spreadsheet Interfaces 292
Implementing the Server Spreadsheet 302
Using Lambda Expressions in the Spreadsheet . 302
Assigning State Without Knowing the Type . 304
Overriding the ToString() Functionality 307
Using the Spreadsheet . 308
Calculating an Average 308
Understanding Why the Calculation Worked 310
The Important Stuff to Remember 311
Some Things for You to Do . 312
CHAPTER 12 Learning About Application Configuration
and Dynamic Loading . 313
Convention over Configuration . 313
Decoupling Using a Configuration Architecture315
Decoupling Using a Convention Architecture315
Setting Up the Dynamic Loading Projects . 316
Signing an Assembly 317
Setting the Output Path 318
Defining and Processing a Configuration File 319
Creating an XML-Based Configuration File . 319
Adding the Dynamic Loading Configuration Items 321
Reading a Configuration File . 321
Dynamically Loading an Assembly 322
Dynamically Instantiating a Type 322
Enhancing the Configuration File 326
Loading a Strongly Named Assembly 331
Relocating a Strongly Named Assembly to the GAC . 333
Using Version Numbers 333
Implementing a Shared Typed Convention-Based Architecture 337
Dynamically Loading Base Class or Interface Types . 339
The Important Stuff to Remember 339
Some Things for You to Do . 340
CHAPTER 13 Learning About Multithreading . 341
Understanding Multitasking . 341
Preemptive Multitasking 342
Time Slicing. 342
Using Threads . 344
Creating a New Thread 345
Waiting for the Thread to End 346
Creating a Thread with State. 347
Synchronizing Between Threads349
How Not to Deadlock Your Code (Mostly) 355
Implementing a Reader/Writer Threaded Architecture 359
Implementing a Producer/Consumer Architecture . 363
Using a Hidden Producer/Consumer Implementation363
Implementing a Generic Producer/Consumer Architecture 364
Using an Asynchronous Approach . 367
The Important Stuff to Remember 368
Some Things for You to Do . 369
CHAPTER 14 Learning About Relational Database Data 371
Understanding Relational Databases 371
Relational Database Tables 371
Database Relations373
Accessing Relational Databases 375
Designing a Database Using Visual Basic Express . 377
Configuring the Data Source . 377
Adding the Tables . 378
Accessing the Database Using ADO.NET 382
Connecting to a Database . 382
Closing a Database Connection 382
Adding Table Data 382
Selecting Data from a Table . 385
Deleting Data from the Database 386
Recapping ADO.NET Usage 386
Using the Dataset Designer . 387
Building Relations Between Tables. 387
Using the Generated Code . 391
The Important Stuff to Remember 392
Some Things for You to Do . 393
CHAPTER 15 Learning About LINQ 395
Finding the Frequency of Winning Numbers . 395
Extending the Lottery-Prediction System396
Implementing a Frequency Solution 400
Learning More LINQ Tricks . 405
Selecting and Altering Data 408
Selecting with Anonymous Types 409
Processing Multiple Streams. 410
Sorting the Results 411
Performing Set Operations. 412
Using LINQ in Other Contexts 413
The Important Stuff to Remember 415
Some Things for You to Do . 416
CHAPTER 16 Learning About Other Visual Basic Techniques 417
Operators 417
Using Arithmetic Operators 417
Overloading Operators . 420
The GoTo Statement 422
.NET Generics Constraints 423
Using the Type Constraint . 423
Using the New Constraint . 425
Using the Class Constraint . 425
Nullable Types . 426
Partial Classes and Methods 427
The Important Stuff to Remember 430
Some Things for You to Do . 431
INDEX . 433 Beginning VB 2008 From Novice to Professional PDF版 英文版  第1张
转载请说明出处
知优网 » Beginning VB 2008 From Novice to Professional PDF版 英文版

发表评论

您需要后才能发表评论