CONTENTS Specifying the Desired Degree of Parallelism 786 ParallelOptions 786 System.Threading.Tasks.Task 790 Summary 813 CHAPTER 20: DEPLOYING XAML APPLICATIONS VIA A New Deployment Op
Trang 3PROFESSIONAL VISUAL BASIC® 2012
AND NET 4.5 PROGRAMMING
INTRODUCTION xxxi
PART I LANGUAGE CONSTRUCTS AND ENVIRONMENT CHAPTER 1 Visual Studio 2012 3
CHAPTER 2 The Common Language Runtime 57
CHAPTER 3 Objects and Visual Basic 103
CHAPTER 4 Custom Objects 179
CHAPTER 5 Advanced Language Constructs 237
CHAPTER 6 Exception Handling and Debugging 263
PART II BUSINESS OBJECTS AND DATA ACCESS CHAPTER 7 Arrays, Collections, and Generics 281
CHAPTER 8 Using XML with Visual Basic 315
CHAPTER 9 ADO.NET and LINQ 369
CHAPTER 10 Data Access with the Entity Framework 407
CHAPTER 11 Services (XML/WCF) 429
PART III SPECIALIZED TOPICS AND LIBRARIES CHAPTER 12 XAML Essentials 465
CHAPTER 13 Creating XAML Applications for Windows 8 517
CHAPTER 14 Applications with ASP.NET, MVC, JavaScript, and HTML 561
CHAPTER 15 Localization 645
CHAPTER 16 Application Services 667
CHAPTER 17 Assemblies and Refl ection 693
CHAPTER 18 Security in the NET Framework 719
CHAPTER 19 Parallel Programming Using Tasks and Threads 757
CHAPTER 20 Deploying XAML Applications via the Windows 8 Windows Store 815
INDEX 833
Trang 5PROFESSIONAL Visual Basic® 2012 and NET 4.5
Programming
Trang 7PROFESSIONAL Visual Basic® 2012 and NET 4.5
Programming
Bill Sheldon Billy Hollis Rob Windsor David McCarter Gastón C Hillar Todd Herman
Trang 8Professional Visual Basic® 2012 and NET 4.5 Programming
Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108
of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 646-8600 Requests to the Publisher for permission should be addressed to the
Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201)
748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including
without limitation warranties of fi tness for a particular purpose No warranty may be created or extended by sales or
promotional materials The advice and strategies contained herein may not be suitable for every situation This work is
sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services If professional assistance is required, the services of a competent professional person should be sought Neither
the publisher nor the author shall be liable for damages arising herefrom The fact that an organization or Web site is
referred to in this work as a citation and/or a potential source of further information does not mean that the author or the
publisher endorses the information the organization or Web site may provide or recommendations it may make Further,
readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this
work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand Some material included with
standard print versions of this book may not be included in e-books or in print-on-demand If this book refers to media
such as a CD or DVD that is not included in the version you purchased, you may download this material at
http://booksupport.wiley.com For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2012946061
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress
are trademarks or registered trademarks of John Wiley & Sons, Inc and/or its affi liates, in the United States and
other countries, and may not be used without written permission Visual Basic is a registered trademark of Microsoft
Corporation All other trademarks are the property of their respective owners John Wiley & Sons, Inc., is not associated
with any product or vendor mentioned in this book.
Trang 9This book is dedicated to Tracie, Billy, and Johnny, who had to put up with me locking myself away in my home offi ce and not spending as much time with them as I'd like and they deserved
—Bill Sheldon
I’d like to dedicate this book to those in the software development community who put users fi rst I’ve watched with regret as our profession has become inwardly focused, worrying far more about technology and process than what we can accomplish for our users and the businesses for which they work I salute those who invest the time and effort to deliver compelling and wonderful experiences to their users, and I hope the material I contributed to this book will help them do that
For my wife, Amy Thank you for your support while I worked
on this project I must also thank my son, Aidan, and daughter, Alaina, for their support and understanding while I was busy in
my offi ce rather than spending time with them I love all of you
Thank you
—Todd Herman
Trang 11ABOUT THE AUTHORS
BILL SHELDON is a software architect and engineer, originally from Baltimore, Maryland Holding
a degree in computer science from the Illinois Institute of Technology (IIT), Bill has worked in the
IT industry since resigning his commission with the United States Navy He is the Vice President of Information Technology for Rubio’s Restaurants (www.rubios.com) and has eight years as a Microsoft MVP for Visual Basic Bill lives in Oceanside, California, with his wife and two sons Bill is an avid cyclist and is active in the fi ght against diabetes You can track Bill down via Twitter: @NerdNotes
BILLY HOLLIS is a developer and user-experience designer based in Nashville, Tennessee His consulting company, Next Version Systems, offers design and development on software applications requiring innovative and intuitive user experiences He speaks regularly at major industry confer-ences, usually on design concepts and user experience technologies He is also available for training
in XAML technologies and in user experience design concepts
ROB WINDSOR is a Lead SharePoint Consultant with Portal Solutions—a Microsoft Gold Partner based in Washington, D.C., and Boston He has 20 years’ experience developing rich-client and web applications with Delphi, VB, C#, and VB.NET, and is currently spending a majority of his time working with SharePoint Rob is a regular speaker at conferences, code camps, and user groups across North America and Europe He regularly contributes articles and videos to MSDN, TechNet,
and the Pluralsight On-Demand library, and is the coauthor of Professional Visual Basic 2010 and NET 4 Rob is the founder and past president of the North Toronto NET User Group and has been
recognized as a Microsoft Most Valuable Professional for his involvement in the developer community You can follow Rob on Twitter at @robwindsor
DAVID MCCARTER is a Microsoft MVP and a principal software engineer/architect in San Diego
He is the editor-in-chief of dotNetTips.com, a website dedicated to helping programmers in all aspects of programming David has written for programming magazines and has published four
books, the latest of which is David McCarter’s NET Coding Standards, and is available at:
http://codingstandards.notlong.com He is one of the founders and directors of the old San Diego NET Developers Group (www.sddotnetdg.org) In 2008 David won the INETA Community Excellence Award for his involvement in the NET community David is also an inventor of a software printing system that was approved by the U.S Patent Offi ce in May 2008
Trang 1218-year-GASTÓN C HILLAR is an Italian living in Argentina He has been working with computers since he
was eight years old He began programming with the legendary Texas TI-99/4A and Commodore 64
home computers in the early ’80s He has worked as developer, architect, project manager, and IT
consultant for many companies around the world He is always looking for new adventures around
the world Gastón has written four books in English, contributed chapters to three other books, and
has written more than 40 books in Spanish He contributes to Dr Dobbs at http://drdobbs.com,
and is a guest blogger for Intel Software Network at http://software.intel.com In 2009, 2010,
2011, and 2012, he received the Intel® Black Belt Software Developer award In 2011, he received
the Microsoft MVP on Technical Computing award
Gastón lives in Argentina with his wife, Vanesa, and his son, Kevin When not tinkering with
computers, he enjoys developing and playing with wireless virtual reality devices and electronic toys
with his father, his son, and his nephew Nico You can reach him at gastonhillar@hotmail
.com You can follow him on Twitter at http://twitter.com/gastonhillar Gastón’s blog is at
http://csharpmulticore.blogspot.com
TODD HERMAN works for APX Labs as a senior software engineer His current focus is developing a
robust library to support the XMPP standard He has been programming since he received his fi rst
computer, a Commodore 64, on his 11th birthday His experience ranges from developing data entry
software in FoxPro for a water research laboratory, to writing biometric applications in Visual Basic
for NEC He lives in Virginia with his wife and children, spending his free time programming,
playing computer games, and watching the SyFy Channel or reruns of Firefl y.
Trang 13ABOUT THE TECHNICAL EDITORS
DOUG WATERFIELD has been a software developer and architect for over 20 years and has been working with NET languages and related technologies since their fi rst release He has designed and constructed solutions for Fortune 500 and Defense Department clients through Chameleon Consulting, and he is a Senior Software Engineer with Interactive Intelligence, Inc Doug graduated from Rose-Hulman Institute of Technology in 1988 and recently earned PMP (Project Management Professional) certifi cation from PMI Doug and his family are very active in the Avon, Indiana, community through the Boy Scouts of America and other organizations He can be reached at
djw@iquest.net
DOUG PARSONS lives in Northeast Ohio and has been developing software professionally for over
15 years He has a diverse background, having worked in the political, fi nancial, medical, and manufacturing sectors over the course of his career He is currently employed as a Senior NET Developer with Harley-Davidson Motor Company In his free time he tinkers with his various motorcycles, sits on the advisory committee of a High School Technology program, and spends time with his family
Trang 15Mary Beth Wakefi eld
FREELANCER EDITORIAL MANAGER
Trang 17MANY THANKS TO ALL OF THE PEOPLE associated with getting this book together and out the door More so than any other edition, there seemed to be a real struggle as we made some truly major changes to much of the content Thanks to those who stepped up and met the challenges that we were presented with during the production cycle
—Bill Sheldon
THANKS TO BETH MASSI for being too busy to work on this project and thanks to the people at Wrox for accepting Beth’s suggestion that I would be a suitable replacement I’d also like to thank those who helped me advance professionally to the point that this opportunity was even possible:
Craig Flanagan, Sasha Krsmanovic, Jean-Rene Roy, Mark Dunn, Carl Franklin, Richard Campbell, Barry Gervin, Dave Lloyd, Bruce Johnson, Donald Belcham, and everyone at Portal Solutions
—Rob Windsor
Trang 19INTRODUCTION xxxi
PART I: LANGUAGE CONSTRUCTS AND ENVIRONMENT
Summary 56
Trang 20CONTENTS
Types 61Modules 62Assemblies 63
My.Application 94My.Computer 97My.Resources 99My.User 99
Trang 21ParamArray 132
Trang 22Summary 235
Trang 23CONTENTS
Summary 278 PART II: BUSINESS OBJECTS AND DATA ACCESS
Arrays 282
Trang 24Summary 368
DataTableCollection 395DataRelationCollection 395ExtendedProperties 396
Advanced ADO.NET Features of the DataSet and DataTable Objects 399
Working with the Common Provider Model 401
Summary 406
Trang 25Summary 426
Namespaces 455
Looking at WSDL and the Schema for HelloCustomerService 459
Summary 461
Trang 26CONTENTS
PART III: SPECIALIZED TOPICS AND LIBRARIES
Property Setting: Attribute Syntax vs Element Syntax 470
Panels 472
Brushes 486
DataContext 492
ItemControls 501
Trang 27CONTENTS
Old Elements Replaced by Functional Equivalents in Windows 8 519
AppBar 524
Pickers 542ProgressRing 543ToggleSwitch 544
Changes to the Visual Designer in Visual Studio 2012 547
Trang 28StandardStyles.xaml 555Online Documentation for Grid App and Split App Templates 556
Summary 560
CHAPTER 14: APPLICATIONS WITH ASP.NET, MVC,
Building Windows 8 Style Apps with HTML and JavaScript 638 Summary 644
Summary 665
Trang 29CONTENTS
Creating a Windows Service in Visual Basic 675
Trang 30CONTENTS
Summary 716
The System.Security.Permissions Namespace 723
Defi ning Your Application UAC Settings 735
PKCS 747
Summary 754
CHAPTER 19: PARALLEL PROGRAMMING USING
Trang 31CONTENTS
Specifying the Desired Degree of Parallelism 786
ParallelOptions 786
System.Threading.Tasks.Task 790
Summary 813
CHAPTER 20: DEPLOYING XAML APPLICATIONS VIA
A New Deployment Option for Windows 8 Apps 815
Getting an Account at the Windows Store 817
Requirements for Apps in the Windows Store 821
Working with the Windows Store in Visual Studio 2012 823
Side-loading for LOB Apps in an Organization 828
Summary 831
INDEX 833
Trang 33WELCOME TO THE NEXT ERA in NET development .NET has moved from a set of focused tools and a runtime environment to the core of the latest Microsoft operating system In
developer-2002, Microsoft released NET and introduced developers to a new paradigm for building tions For Visual Basic it was not only a new environment, but really a new language
applica-Visual Basic NET (as it was initially called) went beyond an overhaul .NET changed core elements of the syntax affecting every aspect of development with Visual Basic The entire runtime model shifted
to a new common language runtime (CLR) environment and the language went from object-based to object-oriented Although most people didn’t recognize it, we were moving to a new language
Now with the introduction of Windows RT, Microsoft has again shifted the paradigm Not so much
at the language level, but as it relates to how user interfaces are developed and work The original runtime environment, although enhanced for NET 4.5, risks being fl agged as being on the path to that fatal “legacy” designator Windows 8 introduces the concept of Windows Store applications, which are built on a version of the CLR that has different features, and that’s important Because while client applications may view the core CLR as legacy, server-based applications have probably never been in a position to leverage it more
This book provides details about not only the latest version of Visual Basic and the new NET Framework 4.5 More important, it carries this coverage to a new platform, Windows RT, and a new class of Windows Store applications As a result the contents of this book have been turned upside down This book doesn’t just indicate that there are new Windows Store applications, but focuses in directly on how to build and deploy this new class of applications The result is a very dif-ferent book from the previous edition
If you compare this edition to an older edition you’ll immediately realize that this edition is visibly smaller Just as you saw Visual Basic evolve nearly 10 years ago, NET is going through an evolu-tion of its own The result was a need to refocus on what this book covers This has resulted in a sea change with regard to where to focus coverage for Visual Basic
The most noticeable omission from the book is in fact the original smart client development model—Windows Forms When Microsoft introduced WPF it informally announced that the era of Windows Forms was ending It has taken some time, and certainly support will continue for many more years, but the reality is that the evolution of Windows Forms is complete The information around Windows Forms provided in past editions of this book is essentially complete While one or two of the chapters do still reference Windows Forms in their samples, by and large the book has moved beyond the use of this technology
The result was that Billy Hollis, who has a passion for user interface design, agreed to take
on the rather signifi cant task of re-imagining how to approach user interface design in a world that includes Windows RT The new XAML-based interface design chapters are completely redone from the ground up and focused on teaching developers how to approach XAML development from the ground up The last version of the book approached the user interface model from Windows Forms
Trang 34and transitioning to XAML However, in this version the approach takes on XAML as the primary
user interface development model As such these chapters address Windows Store application
development head-on, not as an afterthought
However, Windows Forms wasn’t alone in being moved into the past We’ve eliminated several
appen-dices, Microsoft Offi ce (both VSTO and SharePoint) integration, and references to classic COM Some,
for example, development around Microsoft Offi ce, is facing its own set of changes as Microsoft Offi ce
prepares to evolve Others, such as classic COM and Windows Forms, are no longer technologies that
developers should be targeting We also found ourselves needing to change out how we addressed
larger topics such as ASP.NET and Silverlight The result is that this book is much more focused on
building applications using Visual Basic that target Microsoft’s core next generation of technologies
THE FUTURE OF VISUAL BASIC
Early in the adoption cycle of NET, Microsoft’s new language, C#, got the lion’s share of
atten-tion However, as NET adoption has increased, Visual Basic’s continuing importance has also been
apparent Microsoft has publicly stated that it considers Visual Basic to be the language of choice for
applications for which developer productivity is one of the highest priorities
In the past, it was common for Microsoft and others to “target” different development styles; with
Visual Studio 2010, Microsoft announced that VB and C# will follow a process of coevolution As
new language features are developed, they will be introduced to both Visual Basic and C# at the
same time This release is the fi rst step in that process, although it’s not complete at this time
Coevolution does not mean that the languages will look the same, but rather that they will support
the same capabilities For example, Visual Basic has XML literals, but that doesn't mean C# will
get exactly the same functionality, as C# has the capability to work with XML through the existing
framework classes The old process of fi rst introducing a feature in Visual Basic and then in the next
release having C# catch up, and vice versa, is over As new capabilities and features are introduced,
they are being introduced to both Visual Basic and C# at the same time
This leads to a discussion of the “Roslyn” compiler implementation It seems like almost fi ve years
ago that the fi rst whispers of a new 64-bit Visual Basic compiler implemented with Visual Basic
started Considered the standard for a serious language, implementing a language compiler in the
language it compiles has become something of a standard
However, over time this project evolved Microsoft, seeing commonalities across the C# and Visual
Basic compilation projects, realized that once the core syntax had been consumed the remainder of
the compilation process was common across languages While each implementation language needed
a custom solution to handle parsing and interpreting the raw “code,” once that code had been
con-verted to Intermediate Language (IL) the remaining compiler steps were essentially the same
Suddenly a new concept—the compiler as a service—was created Code-named Roslyn, this is
the future for both Visual Basic and C# compilation Roslyn takes the traditional compiler as a
“black-box” and provides an interface that for interacting with the creation of NET assemblies
Introducing an API that exposes your components during the compilation process is a powerful
tool Roslyn has been in a technology preview model since well before the release of Visual Studio
Trang 352012 was designed so that those people who move to the latest tools are limited when working with
a team that hasn’t fully migrated to that new version
More important, Visual Studio 2012 comes with a promise of updates It’ll be interesting to see how this plays out over the coming months, but the Visual Studio team has indicated that they will be releasing regular updates to Visual Studio Update 1 has already been announced as this book goes
to print, and the team has indicated that they would like to continue with updates on a quarterly basis This goes beyond what we’ve seen in the past, with Power Pack style updates that occurred out
of the standard release cycle Instead we see that Microsoft is committing to keeping Visual Studio
on the cutting edge of evolving technology As the environments we developers need to support change, we can expect that Visual Studio will be adapting and incrementally improving to help us.While these changes may not involve changes to the core of the NET framework, we can expect NET
to remain the most productive environment for custom applications One of the most important tages of the NET Framework is that it enables applications to be written with dramatically less code then other alternatives Originally this was in comparison to older technologies, but today the compari-son is as opposed to writing native solutions that support the many different platforms and operating systems you need to support In the world of business applications, the goal is to concentrate on writing business logic and to eliminate routine coding tasks as much as possible In other words, of greatest value in this new paradigm is writing robust, useful applications without churning out a lot of code.Visual Basic is an excellent fi t for this type of development, which makes up the bulk of software development in today’s economy Moreover, it will grow to be an even better fi t as it is refi ned and evolves for exactly that purpose
advan-WHO THIS BOOK IS FOR
This book was written to help experienced developers learn Visual Basic For those who are just starting the transition from other languages or earlier versions to those who have used Visual Basic for a while and need to gain a deeper understanding, this book provides information on the most common programming tasks and concepts you need
Professional Visual Basic 2012 and NET 4.5 Programming offers a wide-ranging presentation of
Visual Basic concepts, but the NET Framework is so large and comprehensive that no single book can cover it all The focus in this book is providing a working knowledge of key technologies that are important to Visual Basic developers It provides adequate knowledge for a developer to work across both Windows Store applications through WCF services This book is meant to provide a breadth of knowledge about how to leverage Visual Basic when developing applications For certain specifi c technologies, developers may choose to add to their knowledge by following this book with
a book dedicated entirely to a single technology area
Trang 36WHAT THIS BOOK COVERS
This book covers Visual Basic from start to fi nish It starts by introducing Visual Studio 2010
As the tool you’ll use to work with Visual Basic, understanding Visual Studio’s core capabilities
is key to your success and enjoyment with building NET applications In these pages, you have
the opportunity to learn everything from database access, Language Integrated Queries (LINQ),
and the Entity Framework, to integration with other technologies such as WPF, WCF, and
service-based solutions Along with investigating new features in detail, you’ll see that Visual Basic 10 has
emerged as a powerful yet easy-to-use language that enables you to target the Internet just as easily
as the desktop This book covers the NET Framework 4
HOW THIS BOOK IS STRUCTURED
Part I, “Language Constructs and Environment”—The fi rst six chapters of the book focus on core
language elements and development tools used by Visual Basic developers This section introduces
Visual Studio 2012, objects, syntax, and debugging
Visual Basic This chapter looks at the Visual Studio development environment Introducing
a simple WPF application project and reviewing key capabilities like the debugger, this
chap-ter will help you to prepare for and become comfortable with this powerful environment
.NET platform: the common language runtime (CLR) The CLR is responsible for
manag-ing the execution of code compiled for the NET platform, as well as on the Windows RT
platform This chapter introduces you to how the different versions of the CLR are in fact
closer to different operating systems than to a common environment You’ll learn about
versioning and deployment, memory management, cross-language integration, metadata,
and the IL Disassembler The chapter also introduces namespaces and their
hierarchi-cal structure An explanation of namespaces and some common examples are provided
In addition, you learn about custom namespaces, and how to import and alias existing
namespaces within projects This chapter also looks at the My namespace available in
Visual Basic
object-oriented programming in Visual Basic This chapter introduces the basics of objects, types,
type conversion, reference types, and the key syntax which make up the core of Visual Basic
they fi t within Visual Basic Starting with inheritance, you create simple and abstract classes
and learn how to create base classes from which other classes can be derived This chapter
puts the theory of object-oriented development into practice The four defi ning
object-ori-ented concepts (abstraction, encapsulation, polymorphism, inheritance) are described, and
you will learn how these concepts can be applied in design and development to create
effec-tive object-oriented applications
Trang 37advanced language concepts such as lambda expressions, the new Async keyword, and Iterators Each of these provides key capabilities that are new to Visual Basic 2012, and this new chapter provides details on how you can leverage these new language constructs
and debugging work in Visual Basic by discussing the CLR exception handler and the Try
Catch Finally structure Also covered are error and trace logging, and how you can use these methods to obtain feedback about how your program is working
Part II, “Business Objects and Data Access”—The next fi ve chapters, Chapter 7 through Chapter
11, look at common structures used to contain and access data This includes framework elements such as arrays and collections, XML, database access, and Windows Communication Foundation (WCF) services These chapters focus on gathering data for use within your applications
collections as a baseline for having a set of related items It then expands on these basic tures by exploring generics Introduced with version 2.0 of the NET Framework, generics enable strongly typed collections
.NET Framework that facilitate the generation and manipulation of XML We describe the NET Framework’s XML-related namespaces, and a subset of the classes exposed by these namespaces is examined in detail
the ADO.NET object model in order to build fl exible, fast, and scalable data-access objects and applications The evolution of ADO into ADO.NET is explored, and the main objects in ADO.NET that you need to understand in order to build data access into your NET appli-cations are explained Additionally, this chapter delves into LINQ to SQL LINQ offers the capability to easily access underlying data—basically a layer on top of ADO.NET Microsoft has provided LINQ as a lightweight façade that provides a strongly typed interface to the underlying data stores
implementation of an Entity Relationship Modeling (ERM) tool Using EF, developers can generate classes to represent the data structures that are defi ned within SQL Server, and leverage these objects within their applications
components that allow for standards-based communications over a number of protocols
WCF is Microsoft’s answer for component communications within and outside of the enterprise
Part III, “Specialized Topics and Libraries”—Chapters 12 through Chapter 14 focus on creating
client applications These chapters address Windows Store applications, which are exclusive to the Windows RT CLR In parallel it discusses building applications for WPF that are compatible with earlier versions of Windows and which represent the majority of corporate applications Chapter 14
Trang 38moves to looking at web-based applications and interfaces Chapters 15 through 20 then focus on
topics such as localization, windows services, security, multi-threaded applications, and deployment
associated with the Windows Presentation Foundation With the transition to Windows Store
applications, XAML is still applicable, although it behaves slightly differently This
chap-ter introduces you to building applications focused on the XAML model of user inchap-terface
declaration
into the specifi cs around building Windows Store applications The chapter looks at
spe-cifi c conventions around Windows 8 user interfaces, new features spespe-cifi c to Windows 8,
and leveraging the visual designer that is part of Visual Studio 2012 This chapter gets into
the nuts-and-bolts steps for handling things like Live Tiles and contracts for Windows 8
integration
goes through web-based application development It covers examples of everything from
ASP.NET with AJAX and CSS to MVC (Model-View-Controller) applications
con-sider when building your applications for worldwide use It looks closely at the System.
Globalization namespace and everything it offers your applications
production of Windows Services The creation, installation, running, and debugging of
Windows Services are covered
within the CLR The structure of an assembly, what it contains, and the information it
con-tains are described In addition, you will look at the manifest of the assembly and its role in
deployment, and how to use remoting
.Security.Permissions namespace including how it relates to managing permissions You
also look at the System.Security.Cryptography namespace and run through some code
that demonstrates its capabilities
threading and explains how the various objects in the NET Framework enable any of its
consumers to develop multithreaded applications You will learn how threads can be created,
how they relate to processes, and the differences between multitasking and multithreading
chapter takes a close look at using the Windows Store to deploy applications You will see
the new Windows 8 deployment options and how to set up an account with the Windows
Store for deploying your applications It also looks at how enterprise developers will deploy
custom internal line-of-business applications on Windows 8
Trang 39WHAT YOU NEED TO USE THIS BOOK
Although it is possible to create Visual Basic applications using the command-line tools contained in the NET Framework, you’ll want Visual Studio 2012, which includes the NET Framework 4.5, to get the most out of this book In addition, note the following:
‰ You’ll need NET Framework 4.5, which is installed with whatever version of Visual Studio
Several chapters make use of Internet Information Services (IIS) IIS is part of every operating system released by Microsoft since Windows XP, but on newer operating systems you’ll need to run
as administrator to develop against it Alternatively, you can leverage the development server that ships with Visual Studio 2012
The source code for the samples is available for download from the Wrox website at:
As for styles in the text:
‰ We italicize new terms and important words when we introduce them.
‰ We show keyboard strokes like this: Ctrl+A
Trang 40‰ We show fi lenames, URLs, and code within the text like so: persistence.properties
‰ We present code in two different ways:
We use a monofont type with no highlighting for most code examples.
We use bold to emphasize code that is particularly important in the present
context or to show changes from a previous code snippet.
SOURCE CODE
As you work through the examples in this book, you may choose either to type in all the code
manually, or to use the source code fi les that accompany the book All the source code used in this
book is available for download at www.wrox.com. Specifi cally for this book, the code download is
on the Download Code tab at:
www.wrox.com/remtitle.cgi?isbn=9781118314456
You can also search for the book at www.wrox.com by ISBN (the ISBN for this book is
978-1-118-31445-6) to fi nd the code And a complete list of code downloads for all current Wrox
books is available at www.wrox.com/dynamic/books/download.aspx.
At the beginning of each chapter that contains downloadable code, we’ve provided a reminder of
the link you can use to fi nd the code fi les Throughout the chapter, you’ll also fi nd references to the
names of code fi les in the listing titles or the text
Most of the code on www.wrox.com is compressed in a ZIP, RAR archive, or similar archive
format appropriate to the platform Once you download the code, just decompress it with an
appro-priate compression tool
NOTE Because many books have similar titles, you may fi nd it easiest to search
by ISBN; this book’s ISBN is 978-1-118-31445-6.
Once you download the code, just decompress it with your favorite compression tool Alternately,
you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download
.aspx to see the code available for this book and all other Wrox books
ERRATA
We make every effort to ensure that there are no errors in the text or in the code However, no one
is perfect, and mistakes do occur If you fi nd an error in one of our books, like a spelling mistake or
a faulty piece of code, we would be very grateful for your feedback By sending in errata, you may
save another reader hours of frustration, and at the same time, you will be helping us provide even
higher-quality information