Table of Contents

Part I Building Applications with LightSwitch

1 Introducing Visual Studio LightSwitch

Who Uses LightSwitch?

A Short History of Microsoft Business Tools

Microsoft Access with Visual Basic for Applications

Microsoft Visual Basic 6

Microsoft Visual FoxPro

Microsoft Visual Studio .NET (2002 to 2010)

About Visual Studio LightSwitch

Technologies Used Behind the Scenes

Available Editions

Companion Source Code

Setting Up the Development Machine

Operating System

Development Environment

Server Components

Database Tools

Controls and Toolkits

What You Need to Know About Programming

Summary

2 Exploring the IDE

Getting Started with Visual Studio LightSwitch

Introducing the Start Page

Creating New Projects and Exploring Solutions

The LightSwitch Designer

The Entity Designer

The Screen Designer

The Properties Window

The Query Designer

The Application Designer

The Code Editor

Building, Running, and Debugging Applications

Managing and Arranging Windows

Getting Help

Visual Studio 2010 with LightSwitch

Summary

3 Building Data-Centric Applications

Creating a New Application

Creating a New Data Source

Adding Entity Properties

Building a Complete Entity

Data Storage

The User Interface: Implementing Screens

Controls Overview

Creating a Data Entry Screen

Creating a Search Screen

Testing the Application on the Development Machine

Starting the Application as a Desktop Client

Adding and Editing Data

Displaying and Searching Data

Exporting Data to Microsoft Excel

Basic Screen Customizations

Running the Application as a 3-Tier Desktop Client

Running the Application in the Web Browser

Input-Data Validation

Required Fields Validation

String-Length Validation

Date Validation

Number Validation

Default Validation of Business Types

Validating Email Addresses

Validating Phone Numbers

Validating Images

Validating Money

Summary

4 Building More-Complex Applications with Relationships and Details Screens

Creating a New LightSwitch Project

Designing Complex Data Sources

Entities That Define Choice Lists

Working with the Money Data Type

Adding Relationships

Using Computed Properties

More-Complex, Business-Oriented User Interfaces

Creating Data Entry Screens

Creating Search Screens

Running the Application and Entering Data

Editing Data with Editable Grids

Handling Master-Details Relationships with Details Screens

Editing the Screen Navigation Control

Customizing the Look and Feel of Screens

Implementing Data Validation

Validation on Master-Details Relationships

Summary

Part II Manipulating Data

5 Customizing Data Validation

Understanding the Validation Model

Built-In Validation Rules

Writing Custom Validation Rules

Client Validation: Validating Entity Properties

Client and Server Validation: Validating a Single Entity

Data Validation on the Server: Validating Entity Collections

Validation in Master-Details Relationships

For the Experts: Implementing Complex Validation Rules with the .NET Framework

Summary

6 Querying, Filtering, and Sorting Data

Querying Data in LightSwitch

Applying Filters

Applying Filters at the Data Level

Understanding the Query Event Model

Applying Filters at the Screen Level

Applying Sorting Logic

Sorting at the Data Level

Sorting at the Screen Level

Basing Queries on Other Queries

Summary

7 Customizing Applications with Buttons, COM Automation, and Extensions

Customizing the Command Bars

Adding Built-In Buttons to the Screen Command Bar

Adding and Managing Custom Buttons

Handling More-Complex Scenarios with COM Interoperability

Downloading, Installing, and Using Extensions

Extensions Types in Visual Studio LightSwitch

Downloading and Installing Extensions

Using Extensions

Summary

8 Aggregating Data from Different Data Sources

Connecting to SQL Server Databases

Installing the Sample Northwind Database

Creating New Applications on Existing SQL Server Databases

Aggregating Data from Existing Databases into LightSwitch Applications

Database in the Cloud: Connecting to SQL Azure

Establishing Connections to SQL Azure

Creating a SQL Azure Database

Connecting LightSwitch Applications to SQL Azure

Collaboration: Working with Lists from SharePoint 2010

Running the Default Website

Configuring a Vacation Plan Calendar on SharePoint 2010

Extending LightSwitch Applications with SharePoint Data

Summary

Part III Securing and Deploying Applications

9 Implementing Authentication and Authorization

Understanding Authentication

Implementing Windows Authentication

Setting Up the Development Environment

Authorization: Settings Permissions

Writing the Permission Logic

Permission Logic on Entities

Permission Logic on the User Interface

Debugging the Application

Creating User Roles and Administering the Application

Implementing Forms Authentication

Publishing Applications with Forms Authentication

Testing the Application with Different Credentials

Permission Elevation on Server Code

Summary

10 Deploying LightSwitch Applications

Deployment Fundamentals

Understanding 2-Tier and 3-Tier Applications

Preparing the Application for Deployment

Specifying the Application Name and Logo

Styling the Application

Runtime Settings

Localizing an Application

Deploying 2-Tier Applications

Client Configuration

Application Server Configuration

Publish Output

Database Connections

Prerequisites

Other Connections

Specifying a Certificate

Publish Summary

Publishing and Deploying the Application

Deploying 3-Tier Applications

Configuring the Target Web Server

Publishing the Application

Remotely Publishing to a Web Server

Creating and Importing Packages into IIS

Deploying to Windows Azure

Preparing Applications to Deployment

Summary

Part IV Advanced LightSwitch

11 Handling Events in Code

Working with Entities in Code

Understanding Data Objects

Handling Data Events in Code

Handling Custom Query Events in Code

Handling Screen Events in Code

Button Methods

General Methods

Collection Methods

Launching Screens Programmatically

Opening Screens Without Passing Parameters

Opening Screens by Passing Parameters

Summary

12 Dissecting a LightSwitch Application

Applications Architecture and Tiers

Architecture Overview

Understanding the Data Access and Storage Tiers

Understanding the Logic Tier

Understanding the Presentation Tier

Dissecting LightSwitch Projects

Overview of LightSwitch Solutions

Server-Side Projects

Middle-Tier Projects

Client-Side Projects

Summary

13 Advanced LightSwitch with Visual Studio 2010

Managing the Application Life Cycle with TFS 2010

Connecting to Team Foundation Server

Creating New Team Projects

Submitting Projects to Source Control

Creating and Assigning Work Items

Retrieving Specific Project Versions with Version Control

Automating Builds

Code Metrics

Unit Testing Your Helper Code

Creating a Test Project

Creating Unit Tests

Analyzing the Execution Flow with IntelliTrace

IntelliTrace Options

IntelliTrace in Action with LightSwitch

IntelliTrace Log Files

Summary

14 Debugging LightSwitch Applications

Debugging Applications

The Error List Tool Window

Breakpoints and Data Tips

Debugging in Steps

About Runtime Errors

The Edit and Continue Feature

Advanced Debugging Instrumentation

Breakpoints and Trace Points Unleashed

Showing a Variables Value in the Locals Window

Evaluating Expressions in the Command Window

Understanding the Method Calls Flow in the Call Stack Window

Watch Windows

Analyzing Threads with the Threads Window

Understanding Debugger Visualizers

Debugging in Code

The Debug Class

Using Debugger Attributes in Code

Summary

Part V Extensibility

15 Customizing the IDE

Customizing Visual Studio LightSwitch

Customizing Commands and Toolbars

Customizing an Existing Toolbar

Creating a New Custom Toolbar

Managing User Settings

Exporting Settings

Importing Settings

Using, Creating, and Managing Reusable Code Snippets

Using Code Snippets

The Code Snippet Manager

Creating and Using Custom Code Snippets

Summary

16 Customizing Applications with Custom Controls

Building Custom Controls

Creating Controls with Visual Studio 2010

Implementing and Aggregating Chart Controls

Binding the User Control to Data and the Screen

Integrating Bing Maps

Claiming Your Bing Maps Developer Keys

Making Bing Maps Available to LightSwitch

Updating Entities to Support Bing Maps

Adding Bing Maps to Screens

Summary

17 Implementing Printing and Reporting

Using the Office Integration Extension

Overview of the Class Library

Creating Emails and Appointments with Microsoft Outlook

Exporting to Microsoft Word and to PDF

Importing and Exporting Data with Microsoft Excel 2010

Using SQL Server Reporting Services

Reporting Extensions from Microsoft Partners

XtraReports from Developer Express

NetAdvantage for LightSwitch from Infragistics

OLAP Extension from Component One

Telerik Reporting for Silverlight

Using Custom Controls for Printing and Reporting

Creating a Visual Report as a User Control

Displaying the Report in the User Interface

Silverlight’s Printing APIs

Summary

18 LightSwitch Extensibility: Themes, Shells, Controls, and Screens

Understanding the Extensibility Model

Creating Themes

Creating a New Extensibility Project

Setting Extension Properties

Adding a Theme to the Extensibility Project

Editing Themes with Visual Studio 2010

Editing Themes with Expression Blend 4

Making the Green Theme

Testing the Custom Theme

Creating Custom Shells

Creating Extensibility Projects for Custom Shells

Editing the Official Sample from Microsoft

Sharing Custom Controls

Available Control Types

Creating Control Extensions

Creating Screen Templates

Designing Custom Screen Templates

Implementing the IScreenTemplate Properties

Generating the Screen Content Tree

Adding Code to the Screen

Testing the Screen Template

Screen Templates Tips and Tricks

Summary

19 LightSwitch Extensibility: Data and Extension Deployment

Creating Business Types

Implementing a New Business Type

Implementing the Data Type Definition

Implementing Data Validation

Designing Controls

Testing the Extension

Creating and Using Custom Data Sources with WCF RIA Services

The .NET Framework for WCF RIA Services

Creating WCF RIA Services to Work with XML Data

Calling WCF RIA Services from LightSwitch Applications

Calling Stored Procedures Through WCF RIA Services

Sharing Custom Data Sources

Testing Custom Data Sources

Handling Connection Strings

Deploying Extensions to Others

Preparing the Deployment Manifest

Uploading VSIX Packages to the Visual Studio Gallery

Releasing Extension Updates

Summary

Appendixes

A Installing and Configuring Visual Studio LightSwitch

Installing Visual Studio LightSwitch

Managing the Offline Documentation

B Useful Resources

MSDN Resources

LightSwitch Developer Center

LightSwitch How-Do-I Videos

LightSwitch Blogs

LightSwitch Forums

Training Kit and Starter Kits

Extensibility Center

The Visual Studio Gallery

Code Samples

Social Networks

Community Resources

Visual Studio LightSwitch Help Website

LightSwitch Video Training on MyVBProf.com

The CodeProject

StackOverflow

Italian LightSwitch Tips & Tricks Community

Other LightSwitch Blogs and Websites

Third-Party Extensions

Document Toolkit for LightSwitch

RSSBus Data Providers

Infragistics NetAdvantage Light Edition

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.249.210