Visual Basic 2015 Unleashed

Book description

Using Visual Basic 2015, developers can build cutting-edge applications that run practically anywhere: on Windows desktops, new Windows 10 devices, in mobile and cloud environments, and beyond. Visual Basic 2015 Unleashed is the most comprehensive, practical reference to modern programming with VB 2015.

Long-time Visual Basic MVP Alessandro Del Sole walks you through the latest version of the language, helping you thoroughly master its most valuable features, most powerful programming techniques, and most effective development patterns. Next, he shows how to use Visual Basic 2015 to build robust, effective software in a wide range of environments.

Extensively updated for Visual Basic 2015’s major improvements, this guide covers both Visual Basic 2015 Professional Edition for professional developers and the free Community Edition for hobbyists, novices, and students. Del Sole has added detailed coverage of building new universal Windows apps for Windows 10 and using new Visual Studio 2015 capabilities to supercharge your productivity as a developer. If you want to leverage all of VB 2015’s power, this is the book you need.

Detailed information on how to...

  • Understand the Visual Studio 2015 IDE, .NET Framework 4.6 and the new .NET Core 5, and the anatomy of a VB 2015 application

  • Debug VB applications and implement error handling and exceptions

  • Keep your code clean and well-organized with VB 2015’s new refactoring tools

  • Master modern VB object development: namespaces, modules, structures, enums, inheritance, interfaces, generics, delegates, events, collections, iterators, and more

  • Share Visual Basic code with Portable Class Libraries and Shared Projects

  • Access data with LINQ and ADO.NET Entity Framework

  • Manipulate XML documents with LINQ and XML Literals

  • Build and deploy applications to run in the Microsoft Azure cloud

  • Develop universal Windows apps that run on any Windows 10 device

  • Use advanced .NET 4.6 platform capabilities, including async and parallel programming, multithreading, assemblies, reflection, and coding attributes

  • Leverage new compiler APIs to write custom domain-specific live code analysis rules

  • Test code with unit tests and TDD 

  • Deploy apps efficiently with InstallShield for Visual Studio and ClickOnce

  • Table of contents

    1. About This eBook
    2. Title Page
    3. Copyright Page
    4. Contents at a Glance
    5. Table of Contents
    6. Foreword
    7. About the Author
    8. Dedication
    9. Acknowledgments
    10. We Want to Hear from You!
    11. Reader Services
    12. Introduction
      1. Code Samples and Software Requirements
        1. Code-Continuation Arrows
    13. Part I: Learning the Basics of VB
      1. Chapter 1. Introducing .NET 2015
        1. .NET 2015: A New Vision for Development
        2. The .NET Framework 4.6 for Desktop
          1. Where Is the .NET Framework?
          2. The Architecture of the .NET Framework 4.6
          3. Differences Between .NET 4.6 and 4.5
          4. The Common Language Runtime
          5. The Base Class Library
        3. Introducing .NET Core 5
          1. What Is Open Source Today?
        4. Programming Languages in Visual Studio 2015
        5. What’s New with Compilers
          1. The .NET Compiler Platform
          2. The .NET Native Technology
        6. The Windows Software Development Kit
        7. Summary
      2. Chapter 2. The Visual Studio 2015 IDE for Visual Basic
        1. What’s New in Visual Studio 2015
        2. Status Bar and Start Page
          1. The News Section
          2. The Discover What’s New Section
          3. The What’s New on Microsoft Platforms Section
          4. The Featured Videos Section
        3. Working with Projects and Solutions
          1. Creating Visual Basic Projects
          2. Multi-targeting
          3. Accessing Recent and Online Templates
          4. Searching for Installed Templates
          5. Finding Code Samples on the Internet
          6. Creating Reusable Projects and Items Templates
          7. Creating Your First Visual Basic 2015 Project
          8. Finding Visual Basic Projects
          9. Working with the Code Editor
        4. Working with Tool Windows
          1. The Solution Explorer Window
          2. The Error List Window
          3. The Properties Window
          4. The Output Window
        5. The My Project Window
          1. Specifying Application Settings in the Application Tab
        6. Compiling Projects
          1. Debug and Release Configurations
          2. Other Compile Options
          3. Advanced Compile Options
        7. Debugging Overview
          1. Debugging an Application
          2. Breakpoints and Data Tips
          3. Runtime Errors
          4. Edit and Continue
        8. Browsing the Visual Basic and .NET Documentation
          1. Online Help and the MSDN Library
          2. Object Browser Window
          3. Inspecting Built-in Types
        9. Quick Launch Tool
        10. Showing the Hierarchy of Method Calls
        11. Summary
      3. Chapter 3. The Anatomy of a Visual Basic Project
        1. Brief Overview of Types and Members
          1. Comments
          2. Classes
          3. Properties
          4. Methods
          5. Modules
          6. Structures
          7. Inheritance
          8. Namespaces
          9. Accessing Members
          10. Imports Directives
          11. Region Directives
          12. Attributes
          13. Implicit Line Continuation
        2. Visual Basic 2015 Reserved Keywords
        3. Understanding Project Files
          1. Dissecting My Project
          2. Application.myapp
          3. AssemblyInfo.vb
          4. Resources and the Resources.resx File
          5. Application Settings
        4. Understanding References
          1. Adding References to COM Libraries
          2. Deploy Without PIAs
          3. Final Considerations
        5. Summary
      4. Chapter 4. Data Types and Expressions
        1. Introducing the Common Type System
          1. Everything Is an Object
          2. Introducing Value Types and Reference Types
          3. System.Object and System.ValueType
        2. Understanding Value Types
          1. .NET Framework Primitive Value Types
          2. Using Value Types
          3. Working with BigInteger
          4. Building Custom Value Types
        3. Understanding Reference Types
          1. .NET Framework Primitive Reference Types
        4. Differences Between Value Types and Reference Types
          1. Memory Allocation
          2. Object-Oriented Differences
          3. Performance Differences
          4. What Custom Type Should I Choose?
        5. Converting Between Value Types and Reference Types
          1. Understanding Implicit Conversions
          2. Boxing and Unboxing
          3. Deep Copy and Shallow Copy
          4. The GetType Keyword
        6. Understanding Conversion Operators
          1. Widening and Narrowing Conversions
        7. Working with .NET Fundamental Types
          1. Working with Strings
          2. Working with Dates
          3. Working with Time
          4. Working with TimeZone and TimeZoneInfo
          5. Working with GUIDs
          6. Working with Arrays
        8. Common Operators
          1. Arithmetic Operators
          2. Assignment Operators
          3. Logical, Bitwise, and Shift Operators
          4. The Ternary If Operator
          5. Concatenation Operators
          6. Comparison Operators
          7. The Null-Conditional Operator: A First Look
        9. Iterations, Loops, and Conditional Code Blocks
          1. Iterations
          2. Loops
          3. Conditional Code Blocks
          4. Constants
          5. With..End With Statements
        10. Summary
      5. Chapter 5. Debugging Visual Basic 2015 Applications
        1. Preparing an Example
        2. Debugging Instrumentation
          1. Debugging in Steps
          2. Mixed Mode Debugging
          3. “Just My Code” Debugging
          4. Working with Breakpoints, Conditions and Actions
          5. PerfTips: Investigating Code Performance
          6. Locals Window
          7. Command Window
          8. Call Stack Window
          9. Watch Windows
          10. Threads Window
          11. Autos Window
        3. Inspecting Object Details with Debugger Visualizers
        4. Debugging in Code
          1. The Debug Class
          2. The Trace Class
          3. Understanding Trace Listeners
          4. Using Debug Attributes in Your Code
        5. Summary
      6. Chapter 6. Errors, Exceptions, and Code Refactoring
        1. Introducing Exceptions
        2. Handling Exceptions
          1. Tips for Visual Basic 6 Migration
          2. System.Exception, Naming Conventions, and Specialization
          3. Handling Exceptions with Try..Catch..Finally Blocks
          4. The Throw Keyword
          5. Catching Exceptions Without a Variable
          6. Handling Warnings
        3. Refactoring Your Code: Light Bulbs and Quick Actions
          1. Fixing Errors and Code Issues
          2. Improving Code Quality: Refactoring
        4. Summary
    14. Part II: Object-Oriented Programming with Visual Basic 2015
      1. Chapter 7. Class Fundamentals
        1. Declaring Classes
          1. Nested Classes
          2. Fields
          3. Avoiding Ambiguities with Local Variables
        2. Storing Information with Properties
          1. Read-Only Properties
          2. Write-Only Properties
          3. Exposing Custom Types
          4. Accessing Properties
          5. Default Properties
        3. Types and Members Visibility: Scope
        4. Executing Actions with Methods
          1. Invoking Methods
          2. Method Arguments: ByVal and ByRef
          3. Overloading Methods
          4. Exit from Methods
        5. Organizing Code with Partial Classes
        6. Splitting Method Definitions with Partial Methods
        7. Instantiating Objects with Constructors
          1. Overloading Constructors
          2. Object Initializers
        8. Shared Members
          1. Shared Classes
          2. Shared Fields
          3. Shared Properties
          4. Shared Methods
          5. Shared Constructors
        9. Common Language Specification
          1. Where Do I Need to Apply?
          2. Marking Assemblies and Types as CLS Compliant
          3. Naming Conventions
          4. Rules About Classes
          5. Rules About Properties
          6. Rules About Methods
          7. Rules About Arrays
        10. Summary
      2. Chapter 8. Managing an Object’s Lifetime
        1. Understanding Memory Allocation
        2. Understanding Garbage Collection
        3. Understanding the Finalize Method
        4. Understanding Dispose and the IDisposable Interface
          1. Using..End Using Statement
          2. Putting Dispose and Finalize Together
          3. Restoring Objects with Object Resurrection
        5. Advanced Garbage Collection
          1. Interacting with the Garbage Collector
          2. Understanding Generations and Operation Modes
        6. Summary
      3. Chapter 9. Organizing Types Within Namespaces
        1. Understanding Namespaces
        2. Organizing Types Within Namespaces
          1. Why Are Namespaces So Useful?
          2. Nested Namespaces
          3. Scope
          4. Root Namespace
          5. Imports Directives
          6. Project-Level Default Imports
          7. Avoiding Ambiguities
          8. Namespaces and the Common Language Specification
        3. Global Namespaces and the Global Keyword
        4. Summary
      4. Chapter 10. Modules
        1. Modules Overview
          1. Partial Modules
          2. Scope
        2. Differences Between Modules and Classes
          1. No Constructor
          2. No Inheritance Support
          3. No Interface Implementation
        3. Summary
      5. Chapter 11. Structures and Enumerations
        1. Understanding Structures
          1. Assigning Structures to Variables
          2. Passing Structures to Methods
          3. Members’ Visibility
          4. Inheritance Limitations and Interface Implementation
          5. Memory Allocation
          6. Organizing Structures
        2. Overloading Operators
          1. Overloading CType
        3. Structures and Common Language Specification
        4. Grouping Constants with Enumerations
          1. Using Enumerations
          2. Useful Methods from System.Enum
          3. Using Enums As Return Values from Methods
          4. Enum Values As Bit Flags
          5. Enumerations and the Common Language Specification
        5. Summary
      6. Chapter 12. Inheritance
        1. Applying Inheritance
          1. Illustrating System.Object in Detail
        2. Introducing Polymorphism
        3. Overriding Members
          1. NotOverridable Keyword
          2. Overloading Derived Members
        4. Conditioning Inheritance
          1. NotInheritable Keyword
          2. MustInherit and MustOverride Keywords
        5. Accessing Base Classes Members
          1. MyBase Keyword
          2. MyClass Keyword
        6. Constructors’ Inheritance
        7. Shadowing
        8. Overriding Shared Members
        9. Practical Inheritance: Building Custom Exceptions
        10. Summary
      7. Chapter 13. Interfaces
        1. Defining Interfaces
        2. Implementing and Accessing Interfaces
          1. New Behaviors in Visual Basic 2015
          2. Passing Interfaces as Method Arguments
        3. Partial Interfaces
        4. Interfaces and Polymorphism
        5. Interfaces Inheritance
        6. Defining CLS-Compliant Interfaces
        7. Most Common .NET Interfaces
          1. The IEnumerable Interface
          2. The IComparable Interface
          3. The IConvertible Interface
          4. The IFormattable Interface
        8. Summary
      8. Chapter 14. Generics and Nullable Types
        1. Introducing Generics
        2. Creating and Consuming Generics
          1. Consuming Generic Types
          2. Implementing Generic Methods
          3. Understanding Constraints
          4. Overloading Type Parameters
        3. Introducing Nullable Types
          1. The Null-Propagating Operator and Value Types
        4. Summary
      9. Chapter 15. Delegates and Events
        1. Understanding Delegates
          1. Declaring Delegates
          2. Combining Delegates: Multicast Delegates
        2. Handling Events
          1. Registering for Events: AddHandler and RemoveHandler
          2. Declaring Objects with the WithEvents Keyword
        3. Offering Events to the External World
          1. Raising Events
          2. Creating Custom Events
        4. Summary
      10. Chapter 16. Working with Collections and Iterators
        1. Understanding Collections Architecture
        2. Working with Nongeneric Collections
          1. The ArrayList Collection
          2. The Queue Collection
          3. The Stack Collection
          4. The HashTable Collection
          5. The ListDictionary Collection
          6. The OrderedDictionary Collection
          7. The SortedList Collection
          8. The HybridDictionary Collection
          9. The StringCollection Collection
          10. The StringDictionary Collection
          11. The NameValueCollection Collection
          12. The BitArray Collection
          13. The Bitvector32 Collection
        3. Working with Generic Collections
          1. The List(Of T) Collection
          2. Working with Collection Initializers
          3. The ReadOnlyCollection(Of T) Collection
          4. The Dictionary(Of TKey, TValue) Collection
          5. The SortedDictionary(Of TKey, TValue) Collection
          6. The ObservableCollection(Of T) Collection
          7. The ReadonlyObservableCollection(Of T) Collection
          8. The LinkedList(Of T) Collection
          9. The Queue(Of T) and Stack(Of T) Collections
        4. The Null-Conditional Operator and Collections
        5. Building Custom Collections
        6. Concurrent Collections
        7. Immutable Collections
        8. Iterators
          1. Understanding the Benefits of Iterators in Code
          2. Simple Iterators
          3. Exiting from Iterators
          4. Iterators with Try..Catch..Finally
          5. Anonymous Iterators
          6. Implementing an Iterator Class
        9. Summary
      11. Chapter 17. Working with Objects: Visual Tools and Code Sharing
        1. Visual Studio Class Designer
          1. Enabling the Class Designer
          2. Adding and Designing Objects
          3. Implementing Derived Classes
          4. Creating Multiple Diagrams
          5. Exporting the Diagram
        2. Class View Window
        3. Creating Types with Generate from Usage
          1. Generating Shared Members
          2. On-the-Fly Code and Object Initializers
          3. Generating Complex Objects
        4. Creating Portable Classes
          1. Creating a Sample Portable Library
          2. Deploying Portable Libraries
        5. Shared Projects
          1. Creating Shared Projects
        6. Summary
    15. Part III: Advanced Language Features
      1. Chapter 18. Manipulating Files and Streams
        1. Manipulating Directories and Pathnames
          1. The System.IO.Path Class
          2. The System.IO.Directory Class
          3. The System.IO.DirectoryInfo Class
          4. The System.IO.DriveInfo Class
        2. Handling Exceptions for Directories and Pathnames
        3. Manipulating Files
          1. The System.IO.File Class
          2. The System.IO.FileInfo Class
          3. Handling File Exceptions
          4. Understanding Permissions
        4. Introducing Streams
          1. Reading and Writing Text Files
          2. Reading and Writing Binary Files
          3. Using Memory Streams
          4. Using Streams with Strings
          5. Compressing Data with Streams
          6. Networking with Streams
        5. Summary
      2. Chapter 19. The My Namespace
        1. Introducing the My Namespace
        2. My.Application
          1. Retrieving Assembly Information
          2. Working with Cultures
          3. Deployment and Environment Information
        3. My.Computer
          1. Working with the File System
          2. Working with the Clipboard
          3. Playing Audio Files
          4. Managing the Keyboard
          5. Working with the Registry
          6. Accessing the Network
          7. Getting Computer Information
        4. My.Settings
          1. My.Settings Events
        5. My.Resources
          1. Getting Resources by Name in Code
        6. My.User
        7. My.WebServices
        8. Extending My
          1. Extending My.Application and My.Computer
          2. Extending My.Resources and My.Settings
        9. My in Different Applications
          1. Understanding Application Events
        10. Summary
      3. Chapter 20. Advanced Language Features
        1. Local Type Inference
          1. Option Infer Directive
          2. Local Type Inference Scope
        2. Array Literals
          1. Multidimensional and Jagged Arrays
        3. Extension Methods
          1. Coding Custom Extension Methods
          2. Exporting Extension Methods
        4. Anonymous Types
        5. Relaxed Delegates
        6. Lambda Expressions
          1. Type Inference and Lambda Expressions
          2. Multiline Lambdas
          3. Sub Lambdas
          4. Lexical Closures
          5. Debugging Lambda Expressions
        7. Generic Variance
          1. Covariance
          2. Contra Variance
        8. Summary
    16. Part IV: Data Access with ADO.NET and LINQ
      1. Chapter 21. Introducing ADO.NET and DataSets
        1. System Requirements
        2. Introducing ADO.NET
          1. Data Providers
          2. Connection Modes
          3. Understanding Connections and Data Readers
        3. Introducing DataSets
          1. Creating DataSets
        4. Summary
      2. Chapter 22. Introducing LINQ
        1. What Is LINQ?
        2. LINQ Examples
        3. Language Support
        4. Understanding Providers
        5. Overview of LINQ Architecture
        6. Summary
      3. Chapter 23. LINQ to Objects
        1. Introducing LINQ to Objects
        2. Querying in Memory Objects
          1. Understanding Deferred Execution
        3. Introducing Standard Query Operators
          1. Projection Operators
          2. Restriction Operators
          3. Aggregation Operators
          4. Understanding the Let Keyword
          5. Conversion Operators
          6. Generation Operators
          7. Ordering Operators
          8. Set Operators
          9. Grouping Operators
          10. Union Operators
          11. Equality Operators
          12. Quantifiers
          13. Concatenation Operators
          14. Elements Operators
          15. Partitioning Operators
        4. Summary
      4. Chapter 24. LINQ to SQL
        1. Introducing LINQ to SQL
          1. Prerequisites and Requirements for This Book
          2. Understanding LINQ to SQL Classes
        2. Querying Data with LINQ to SQL
        3. Insert/Update/Delete Operations with LINQ
          1. Inserting Entities
          2. Updating Entities
          3. Deleting Entities
          4. Mapping Stored Procedures
          5. Using the Log
        4. Advanced LINQ to SQL
          1. Custom Validations
          2. Handling Optimistic Concurrency
          3. Using SQL Syntax Against Entities
        5. Summary
      5. Chapter 25. LINQ to DataSets
        1. Querying DataSets with LINQ
          1. Building Complex Queries with Anonymous Types
        2. LINQ to DataSets’ Extension Methods
          1. Understanding CopyToDataTable
          2. Understanding Field(Of T) and SetField(Of T)
        3. Summary
      6. Chapter 26. Introducing ADO.NET Entity Framework
        1. Introducing Entity Framework
        2. Understanding Entity Data Models
          1. Understanding the DbContext Class: The Visual Basic Mapping
          2. Entity Designer Tool Windows
        3. Insert/Update/Delete Operations for Entities
          1. Instantiating the DbContext
          2. Adding Entities
          3. Deleting Entities
          4. Updating Entities
          5. Handling Optimistic Concurrency
          6. Validating Data
        4. Querying EDMs with LINQ to Entities
        5. Querying EDMs with Entity SQL
        6. Mapping Stored Procedures
        7. Introducing the Code First Approach
          1. Coding Your Model
          2. Generating the Database and Executing Data Operations
          3. Introducing Data Annotations
          4. Introducing the Fluent APIs
        8. Summary
      7. Chapter 27. Manipulating XML Documents with LINQ and XML Literals
        1. Introducing LINQ to XML
          1. The System.Xml.Linq Namespace
        2. Writing XML Markup in VB with XML Literals
          1. LINQ Queries with XML Literals
          2. Understanding Embedded Expressions
        3. Summary
    17. Part V: Building Windows Desktop Applications
      1. Chapter 28. Creating WPF Applications
        1. What Is WPF?
          1. Improvements in WPF 4.6
        2. Introducing the WPF Architecture
        3. Building WPF Applications with Visual Studio 2015
        4. Understanding the eXtensible Application Markup Language
          1. Declaring and Using Controls with the Designer and XAML
        5. Understanding Visual Tree and Logical Tree
        6. Handling Events in WPF
          1. A More Thorough Discussion: Introducing the Routed Events
        7. Arranging Controls with Panels
          1. The Grid Panel
          2. The StackPanel Panel
          3. The WrapPanel Panel
          4. The Canvas Panel
          5. The DockPanel Panel
          6. The ViewBox Panel
        8. Managing Windows
          1. Instantiating Windows at Runtime
        9. Introducing the Application Object
        10. Brief Overview of WPF Browser Applications
        11. Live Visual Tree
        12. Summary
      2. Chapter 29. WPF Common Controls
        1. Introducing WPF Controls Features
        2. Understanding the ContentControl
        3. Understanding Common Controls
          1. The Border Control
          2. The Button Control
          3. Showing Dates with the Calendar Control
          4. Item Selection with the CheckBox Control
          5. Selecting Values from a List with the ComboBox Control
          6. Presenting Tabular Data with the DataGrid Control
          7. Selecting Dates with the DatePicker Control
          8. Viewing XPS Documents with the DocumentViewer Control
          9. Drawing Shapes: The Ellipse
          10. Organizing Controls with the Expander
          11. Viewing HTML Contents with Frame
          12. Organizing Controls with the GroupBox Control
          13. Displaying Images with the Image Control
          14. Displaying Text Messages with the Label Control
          15. Presenting Data with the ListBox Control
          16. Presenting Data with the ListView Control
          17. Playing Audio and Video with the MediaElement Control
          18. Building Effective User Interfaces with the Menu Control
          19. Entering Passwords with the PasswordBox Control
          20. Showing the Progress of an Operation with the ProgressBar Control
          21. Accepting User Choices with the RadioButton Control
          22. Drawing Shapes: The Rectangle
          23. Editing Text with the RichTextBox Control
          24. Extended View with the ScrollBar Control
          25. Scrolling the Visual Tree with the ScrollViewer Control
          26. Separating Visual Elements with the Separator Control
          27. Value Selection with the Slider Control
          28. Displaying Information with the StatusBar Control
          29. Organizing User Interfaces with the TabControl Control
          30. Presenting Text with the TextBlock Control
          31. Entering Text with the TextBox Control
          32. Offering Commands with the ToolBar Control
          33. Presenting Hierarchical Data with the TreeView Control
          34. Accessing the Web with the WebBrowser Control
          35. Windows Forms Interoperability with the WindowsFormsHost Control
        4. Using Common Dialogs
        5. Summary
      3. Chapter 30. Brushes, Styles, Templates, and Animations in WPF
        1. Introducing Brushes
          1. Applying a SolidColorBrush
          2. Applying a LinearGradientBrush
          3. Applying a RadialGradientBrush
          4. Applying an ImageBrush
          5. Applying SelectionBrush and CaretBrush
          6. Applying a VisualBrush
          7. Applying a DrawingBrush
          8. Applying a BitmapCacheBrush
        2. Introducing Styles
          1. Styles Inheritance
          2. Understanding Triggers
        3. Introducing Control Templates
        4. Introducing Transformations
          1. Rotating Visual Elements with RotateTransform
          2. Dynamically Resizing Visual Elements with ScaleTransform
          3. Changing Visual Elements’ Angles with SkewTransform
          4. Dynamically Moving Visual Elements with TranslateTransform
          5. Applying Multiple Transforms
        5. Introducing Animations
          1. Applying DoubleAnimation
          2. Applying ColorAnimation
          3. Working with Animation Events
          4. Creating Animations with Visual Basic
        6. Summary
      4. Chapter 31. Manipulating Media and Documents
        1. Viewing Images
        2. Playing Media
        3. Manipulating Documents
          1. Understanding the RichTextBox Control
        4. Viewing XPS Documents
        5. Summary
      5. Chapter 32. Introducing Data-Binding
        1. Introducing the Data-Binding in WPF
          1. Binding UI Elements with the Binding Markup Extension
          2. Understanding the DataGrid and the ObservableCollection
        2. Discussing the Drag and Drop Data-Binding
          1. Creating Tabular Data Forms
          2. Creating Master-Details Forms
          3. Understanding Views and Binding Lists
          4. Implementing String Formatters and Value Converters
        3. Summary
      6. Chapter 33. Localizing Applications
        1. Introducing .NET Localization
        2. Introducing the Multilingual App Toolkit
        3. Windows Forms Localization
        4. WPF Localization
          1. Localizing a WPF Application
        5. Summary
    18. Part VI: Building Web and Mobile Applications
      1. Chapter 34. Building and Publishing ASP.NET Web Applications
        1. Introducing the ASP.NET Model
          1. Platforms and APIs
          2. Understanding Page Requests
          3. Scalability and Performance
          4. Available Project Templates
        2. Web Forms and Master Pages
          1. Web Forms
        3. ASP.NET Controls
          1. Server Controls
          2. HTML Controls
        4. Handling Events
        5. Understanding State Management
          1. The Application State
          2. The Cache State
          3. The Context State
          4. Using Cookies for Saving Information
          5. The Session State
          6. The ViewState State
        6. Creating a Web Application with VB 2015 with Data Access and Pages
          1. Master Pages
          2. Adding the Data Model
          3. Adding a New Web Form
          4. Adding Data Controls
          5. Adding Filtering Capabilities
          6. Adding Navigation Controls
          7. Running the Application
          8. Strongly Typed Data Controls and Model Binding
          9. Forcing Login for Security
        7. Publishing ASP.NET Web Applications
          1. Deployment Overview
          2. The 1-Click Deployment
          3. Classic Publishing
          4. MSDeploy Publish
          5. Web Deploy with MSDeploy
          6. Packaging Web Applications for Manual Installation
        8. Summary
      2. Chapter 35. Building and Deploying Applications for Microsoft Azure
        1. Overview of the Microsoft Azure Platform
        2. Registering for Microsoft Azure
        3. Downloading and Installing Tools for Visual Studio
        4. Introducing the Management Portal
        5. Creating a SQL Azure Database
        6. Creating an ASP.NET Application for the Cloud
        7. Deploying Applications to Microsoft Azure
        8. A Step Further: Web Roles and Worker Roles
        9. Additional Tools
        10. Summary
      3. Chapter 36. Building Universal Apps for Windows 10
        1. Introducing Universal Windows Apps
        2. Introducing the Universal Windows Platform
        3. Registering with the Windows Store
        4. Installing the Developer Tools
        5. Creating Apps with Visual Basic
          1. Implementing a Data Model
          2. Internet Connection, Local Files, and Folders
          3. Defining a Data Template
          4. Understanding Pages, the App Bar, and Navigation
          5. Sharing Content
          6. Raising Toast Notifications
          7. Playing Media
        6. Customizing the Application Manifest
        7. Starting and Debugging Universal Windows Apps
          1. Desktop Mode and Tablet Mode
          2. Understanding .NET Core for Windows 10
        8. Creating and Testing App Packages
        9. Submitting Apps to the Store
        10. Summary
    19. Part VII: Networking and Exposing Data Through Networks
      1. Chapter 37. Creating and Consuming WCF Services
        1. Introducing Windows Communication Foundation
          1. Understanding Endpoints
          2. Address, Binding, Contract: The ABC of WCF
        2. Implementing WCF Services
          1. Implementing Custom Logic for the WCF Service
        3. Consuming WCF Services
          1. Creating the Client and Adding a Service Reference
          2. Understanding the Proxy Class
          3. Invoking Members from the Service
        4. Handling Exceptions in WCF
        5. Hosting WCF Services in Internet Information Services and Microsoft Azure
        6. Configuring Services with the Configuration Editor
        7. Summary
      2. Chapter 38. Implementing and Consuming OData Services
        1. What Are OData Services?
        2. Creating an OData Endpoint
          1. Adding a Data Model
          2. Enabling Code First Migration
          3. Registering the OData Service
          4. Adding Controllers
          5. Implementing Queries
          6. Implementing CRUD Operations
          7. Handling Relationships Between Entities
          8. Publishing an OData Endpoint
          9. Querying Data via HTTP Requests
        3. Consuming OData Services
          1. Creating a Client Application
          2. Accessing and Querying Data
          3. Performing CRUD Operations
        4. Implementing and Consuming Functions
        5. Summary
    20. Part VIII: Advanced .NET Framework with VB 2015
      1. Chapter 39. Serialization
        1. Objects Serialization
          1. Binary Serialization
          2. SOAP Serialization
          3. Providing Serialization for Custom Objects
          4. NonSerialized Events
        2. XML Serialization
          1. Customizing XML Serialization
        3. Custom Serialization
          1. Serialization Events
        4. Serialization with XAML
        5. Serialization in Windows Communication Foundation
          1. JSON Serialization
        6. Serialization in the ADO.NET Entity Framework
        7. Summary
      2. Chapter 40. Processes and Multithreading
        1. Managing Processes
          1. Querying Existing Processes
        2. Introducing Multithreading
          1. Creating Threads
          2. Passing Parameters
        3. Understanding the .NET Thread Pool
          1. Getting and Setting Information in the Thread Pool
        4. Threads Synchronization
          1. The SyncLock..End SyncLock Statement
          2. Synchronization with the Monitor Class
          3. Read/Write Locks
        5. Summary
      3. Chapter 41. Parallel Programming and Parallel LINQ
        1. Introducing Parallel Computing
          1. Introducing Parallel Classes
        2. Understanding and Using Tasks
          1. What Is a Task?
          2. Running Tasks with Parallel.Invoke
          3. Creating, Running, and Managing Tasks: The Task Class
          4. Creating Tasks That Return Values
          5. Exception Handling
          6. Canceling Tasks
          7. The Barrier Class
        3. Parallel Loops
          1. Parallel.For Loop
          2. Parallel.ForEach Loop
        4. Debugging Tools for Parallel Tasks
        5. Concurrent Collections
          1. ConcurrentBag(Of T)
          2. ConcurrentQueue(Of T)
          3. ConcurrentStack(Of T)
          4. ConcurrentDictionary(Of TKey, TValue)
          5. BlockingCollection(Of T)
        6. Introducing Parallel LINQ
          1. Simulating an Intensive Work
          2. Measuring Performances of a Classic LINQ Query
          3. Measuring Performances of a PLINQ Query
          4. Ordering Sequences
          5. AsParallel and Binary Operators
          6. Using ParallelEnumerable
          7. Controlling PLINQ Queries
          8. Handling Exceptions
        7. Summary
      4. Chapter 42. Asynchronous Programming
        1. Overview of Asynchrony
        2. The Old-Fashioned Way: Event-Based Asynchrony
        3. The Old-Fashioned Way: The Asynchronous Programming Model
        4. The Modern Way: The Async Pattern
          1. Where Do I Use Async?
          2. When and Why to Use Async/Await and Comparisons with the TPL
        5. Getting Started with Async/Await
          1. The Synchronous Approach
          2. Event-Based Asynchrony and Callbacks
          3. Asynchrony with Async/Await
          4. How Async and Await Work Behind the Scenes
          5. Documentation and Examples of the Async Pattern
        6. Exception Handling in Async
        7. Implementing Task-Based Asynchrony
          1. Switching Threads
          2. Using Combinators
        8. Cancellation and Progress
          1. Implementing Cancellation
          2. Reporting Progress
        9. Asynchronous Lambda Expressions
        10. Asynchronous I/O File Operations in .NET 4.6
        11. Debugging Tasks
        12. Summary
      5. Chapter 43. Working with Assemblies
        1. Assembly Overview
          1. Information Stored Within Assemblies
          2. Assembly Location
          3. Signing Assemblies
          4. Assembly Information and Attributes
        2. Understanding Application Domains
          1. Creating Application Domains and Executing Assemblies
        3. Security Model in .NET 4.6
          1. Implementing and Requiring Permissions
          2. The Transparency Level 2
          3. Sandboxing
          4. Conditional APTCA
          5. Migrating from Old CAS-Based Code
        4. Summary
      6. Chapter 44. Reflection
        1. Introducing Reflection
        2. Understanding Assemblies’ Metadata
          1. Preparing a Sample Assembly
        3. Getting Assembly Information
        4. Reflecting Types
          1. Reflecting a Single Type
        5. Invoking Code Dynamically
        6. Generating Code at Runtime with Reflection.Emit
          1. Late Binding Concepts
        7. Caller Information
        8. Summary
      7. Chapter 45. Coding Attributes
        1. Applying Attributes
        2. Coding Custom Attributes
          1. Applying Custom Attributes
          2. Applying Attributes Multiple Times
          3. Using CObj in Attribute Arguments
          4. Defining Inheritance
        3. Reflecting Attributes
        4. Summary
      8. Chapter 46. Platform Invokes and Interoperability with the COM Architecture
        1. Importing and Using COM Objects
          1. Importing COM Components into Visual Studio
          2. Using COM Objects in Code
        2. Catching Exceptions
        3. Releasing COM Objects
        4. Calling COM Objects from WPF
          1. Exposing .NET Objects to the COM World
        5. P/Invokes and Unmanaged Code
          1. Understanding P/Invokes
          2. Encapsulating P/Invokes
          3. Converting Types to Unmanaged
          4. The StructLayout Attribute
          5. The VBFixedString Attribute
          6. Handling Exceptions
        6. References to the Win32 API Calls
        7. Summary
      9. Chapter 47. Documenting Source Code with XML Comments
        1. Understanding XML Comments
          1. Enabling XML Comments
        2. Implementing XML Comments
          1. Defining Complex Code Documentation
        3. Generating Compiled Help Files
        4. Summary
    21. Part IX: Applications Deployment
      1. Chapter 48. Understanding the Global Assembly Cache
        1. The Dll Hell Problem
          1. XCopy Deployment
        2. The Global Assembly Cache
          1. Installing and Uninstalling Assemblies
          2. Signing Assemblies with Strong Names
          3. Top Reasons for Installing (or Not) Assemblies to the GAC
        3. Summary
      2. Chapter 49. Setup and Deployment Projects with InstallShield for Visual Studio
        1. Windows Installer Overview
        2. Introducing InstallShield
          1. Obtaining Your Copy of InstallShield LE
        3. Creating a Setup Project
          1. Application Information
          2. Installation Requirements
          3. Application Files
          4. Application Shortcuts
          5. Application Registry
          6. Installation Interview
          7. Specifying Environment Variables
        4. Configuring the Setup Project
        5. Building and Deploying the Windows Installer Package
        6. Summary
      3. Chapter 50. Deploying Applications with ClickOnce
        1. Introducing ClickOnce
          1. How ClickOnce Handles Applications
          2. When to Use ClickOnce
        2. Deploying Applications with ClickOnce
          1. Understanding the Structure of a ClickOnce Deployment
        3. Configuring ClickOnce
          1. Application Files
          2. Prerequisites
          3. Publishing Application Updates
          4. Options
        4. Security Considerations
          1. Providing Certificates
        5. Programmatically Accessing ClickOnce
        6. Registration-Free COM
        7. Summary
    22. Part X: Code Analysis with VB 2015
      1. Chapter 51. Code Analysis: The .NET Compiler Platform and Tools
        1. Live Code Analysis with the .NET Compiler Platform
          1. Getting Started with the .NET Compiler Platform
          2. Assemblies and Namespaces
          3. Understanding Syntax
          4. Understanding Semantics
          5. Understanding Workspaces
          6. Building Analyzers
          7. Building a Code Refactoring
          8. FxCop Live Code Analysis
        2. Calculating Code Metrics
        3. Diagnostic Tools and IntelliTrace
        4. Code Clone Detection
        5. Summary
    23. Appendix A. Useful Resources and Tools for Visual Basic 2015
      1. Visual Basic Resources in MSDN
      2. Useful Developer Tools for Visual Basic
        1. Coding Tools
        2. Networking
        3. Data Access
        4. Miscellaneous
        5. Where to Find Additional Tools
    24. Index
    25. Chapter 52. Advanced IDE Features
      1. Exporting Templates
        1. Exporting Project Templates
        2. Exporting Item Templates
      2. Customizing Visual Studio 2015
        1. Customizing the Tools Menu
        2. Customizing Commands and Toolbars
      3. Managing User Settings
        1. Synchronized Settings
        2. Exporting Settings
        3. Importing Settings
      4. Customizing the Toolbox
      5. Custom Window Layouts
      6. Using, Creating, and Managing Reusable Code Snippets
        1. Consuming Code Snippets
        2. The Code Snippet Manager
        3. Creating and Consuming Custom Code Snippets
      7. Managing Libraries with NuGet
      8. Summary
    26. Chapter 53. Testing Code with Unit Tests and Test-Driven Development
      1. Testing Code with Unit Tests
        1. Creating Unit Tests
        2. Running Unit Tests
        3. Enabling Code Coverage
      2. Introducing Test-Driven Development
        1. Creating a Test Project
        2. Creating Unit Tests
        3. Refactoring Code
      3. Summary
    27. Code Snippets

    Product information

    • Title: Visual Basic 2015 Unleashed
    • Author(s):
    • Release date: July 2015
    • Publisher(s): Sams
    • ISBN: 9780134196664