ptg
ptg
Visual Basic
®
2010
UNLEASHED
800 East 96th Street, Indianapolis, Indiana 46240 USA
Alessandro Del Sole
ptg
Visual Basic
®
2010 Unleashed
Copyright © 2010 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval
system, or transmitted by any means, electronic, mechanical, photocopying, recording,
or otherwise, without written permission from the publisher. No patent liability is
assumed with respect to the use of the information contained herein. Although every
precaution has been taken in the preparation of this book, the publisher and author
assume no responsibility for errors or omissions. Nor is any liability assumed for
damages resulting from the use of the information contained herein.
ISBN-10: 0-672-33154-3
ISBN-13: 978-0-672-33154-1
Library of Congress Cataloging-in-Publication Data
Del Sole, Alessandro.
Visual Basic 2010 unleashed / Alessandro Del Sole.
p. cm.
Includes index.
ISBN 978-0-672-33100-8
1. BASIC (Computer program language) 2. Microsoft Visual BASIC. I. Title.
QA76.73.B3D467 2010
005.2'768--dc22
2010012721
Printed in the United States of America
First Printing: May 2010
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks
have been appropriately capitalized. Pearson Education, Inc. cannot attest to the accu-
racy of this information. Use of a term in this book should not be regarded as affecting
the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possi-
ble, but no warranty or fitness is implied. The information provided is on an “as is”
basis. The author and the publisher shall have neither liability nor responsibility to any
person or entity with respect to any loss or damages arising from the information
contained in this book.
Bulk Sales
Pearson offers excellent discounts on this book when ordered in quantity for bulk
purchases or special sales. For more information, please contact:
U.S. Corporate and Government Sales
1-800-382-3419
corpsales@pearsontechgroup.com
For sales outside of the U.S., please contact:
International Sales
+1-317-581-3793
international@pearsontechgroup.com
Editor-in-Chief
Karen Gettman
Executive Editor
Neil Rowe
Acquisitions Editor
Brook Farling
Development Editor
Mark Renfrow
Managing Editor
Patrick Kanouse
Project Editor
Mandie Frank
Copy Editor
Apostrophe Editing
Services
Indexer
WordWise Publishing
Services LLC
Proofreader
The Wordsmithery
LLC
Technical Editor
Matt Kleinwaks
Publishing
Coordinator
Cindy Teeters
Designer
Gary Adair
Compositor
Mark Shirar
From the Library of Wow! eBook
ptg
Contents at a Glance
Part I Learning the Basics of VB
1 Introducing the .NET Framework 4.0.............................................................1
2 Getting Started with the Visual Studio 2010 IDE .......................................11
3 The Anatomy of a Visual Basic Project.........................................................59
4 Data Types and Expressions..........................................................................85
5 Debugging Visual Basic 2010 Applications ................................................177
6 Handling Errors and Exceptions.................................................................207
Part II Object-Oriented Programming with Visual Basic 2010
7 Class Fundamentals ....................................................................................225
8 Managing an Object’s Lifetime...................................................................267
9 Organizing Types Within Namespaces.......................................................281
10 Modules.......................................................................................................295
11 Structures and Enumerations .....................................................................299
12 Inheritance ..................................................................................................317
13 Interfaces .....................................................................................................341
14 Generics and Nullable Types ......................................................................359
15 Delegates and Events ..................................................................................371
16 Working with Collections ...........................................................................385
17 Visually Designing Objects .........................................................................407
18 “Generate From Usage” Coding Techniques..............................................421
Part III Advanced VB Language features
19 Manipulating Files and Streams .................................................................429
20 The My Namespace.....................................................................................451
21 Advanced Language Features......................................................................485
Part IV Data Access with ADO.NET and LINQ
22 Introducing ADO.NET and DataSets . ........................................................513
23 Introducing LINQ .......................................................................................523
24 LINQ to Objects .........................................................................................531
25 LINQ to SQL................................................................................................561
26 LINQ to DataSets.........................................................................................595
From the Library of Wow! eBook
ptg
27 Introducing ADO.NET Entity Framework ..................................................603
28 Manipulating Xml Documents with LINQ and Xml Literals ....................635
29 Overview of Parallel LINQ ..........................................................................655
Part V Building Windows Applications
30 Creating Windows Forms 4.0 Applications................................................665
31 Creating WPF Applications ........................................................................681
32 WPF Common Controls .............................................................................715
33 Brushes, Styles, Templates, and Animations in WPF .................................745
34 Manipulating Documents and Media ........................................................781
35 Introducing Data-Binding...........................................................................799
36 Localizing Applications...............................................................................829
Part VI Building Web Applications
37 Building ASP.NET Web Applications .........................................................839
38 Publishing ASP.NET Web Applications ......................................................865
39 Building Rich Internet Applications with Silverlight.................................871
40 Building and Deploying Applications for Windows Azure........................899
Part VII Networking and Exposing Data Through Networks
41 Creating and Consuming WCF Services ....................................................927
42 Implementing and Consuming WCF Data Services ..................................949
Part VIII Advanced .NET Framework with VB 2010
43 Serialization.................................................................................................971
44 Processes and Multithreading.....................................................................993
45 Parallel Programming ...............................................................................1005
46 Working with Assemblies .........................................................................1029
47 Reflection ..................................................................................................1043
48 Coding Attributes......................................................................................1065
49 Platform Invokes and Interoperability with the COM Architecture .......1075
50 Documenting the Source Code ................................................................1091
51 Advanced Compilations with MSBuild ....................................................1105
52 Building Customizations for Microsoft Office .........................................1119
Part IX Applications Deployment
53 Understanding the Global Assembly Cache . ..........................................1137
54 Setup & Deployment Projects for Windows Installer . ............................1145
55 Deploying Applications with ClickOnce. ................................................1159
Visual Basic 2010 Unleashed
iv
From the Library of Wow! eBook
- 1
- 2
前往页