what's new in visual studio 2008
DESCRIPTION
Visual Studio 2008 provides advanced development tools, debugging features, database functionality, and innovative features for quickly creating tomorrow’s cutting-edge applications across a variety of platforms.TRANSCRIPT
What’s New in
Visual Studio 2008
About This ClinicThis clinic will provide an overview of Visual Studio 2008 and highlight new features that can increase developer productivity. You'll also be exposed to new C# and VB.NET language features as well as the new Language Integrated Query (LINQ) technology built into the . NET framework 3.5.
Clinic Objectives
After completing this clinic, you will be able to:
Understand benefits that Visual Studio 2008 can bring to developers and enterprises
Describe how multi-targeting support can be used
Explain new language enhancements to C# and VB.NET
Describe the overall purpose of Language Integrated Query (LINQ)
Audience: .NET application developers and technology decision makers
Prerequisites
Experience working with the .NET framework
Familiarity with either C# or VB.NET
Clinic Outline
Session 1: Visual Studio 2008 and Language Features Overview
Session 2: Building Web Applications with Visual Studio 2008
Session 3: Building WPF, WF and WCF Applications with Visual Studio 2008
Session 4: Visual Studio 2008 Office Development Features
Visual Studio 2008 and Language Features
Overview
Overview
Introduction to Visual Studio 2008
.NET Framework Multi-Targeting Support
C# and VB.NET Language Enhancements
Introduction to Language Integrated Query (LINQ)
Section: Introduction to Visual Studio 2008
Benefits of Visual Studio 2008
Visual Studio 2008 Editions
Visual Studio 2008 Team Suite Functionality
Visual Studio 2008 Feature Highlights
Topic: Benefits of Visual Studio 2008
Visual Studio 2008 provides numerous benefits to developers and enterprises:
Employ the latest technologies in the .NET 3.5 framework
Enhance developer productivity
Manage Application Life Cycle
Simplify application deployment
Integrate designers into the development process
Work with data more effectively
Target different .NET framework versions
Leverage new features in the .NET 3.5 framework
Topic: Visual Studio 2008 Editions
Several editions of Visual Studio 2008 are available:
Express
Visual Basic 2008 Express Edition
Visual C# 2008 Express Edition
Visual C++ 2008 Express Edition
Visual Web Developer 2008 Express Edition
Standard Visual Studio 2008 Standard Edition
Professional Visual Studio 2008 Professional Edition
Team Suite Visual Studio 2008 Team Suite (Architect, Developer, Test and Database)
Topic: Visual Studio 2008 Team Suite
Visual Studio 2008 Team Suite contains four main components:
ArchitectSystem, service, application, data center designers
Developer Code editors, visual designers, debugging, unit tests, code metrics
Test Create, edit, manage and run tests
DatabaseDatabase project templates, rename refactoring, visual diff/merge, test data generation
Topic: Visual Studio 2008 Feature Highlights
Visual Studio 2008 provides many new features that significantly enhance developer productivity:
HTML split view designer
LINQ to SQL Designer
JavaScript Intellisense
CSS property viewer
WPF designer
Office designer support
.NET framework multi-targeting support
Section: .NET Framework Multi-Targeting Support
.NET Framework Versions
Configuring an Application's Target Framework
Developing and Maintaining .NET 2.0 Applications
Object Browser Framework Version Filtering
Topic: .NET Framework Versions
Several versions of the .NET framework have been released since 2002:
Visual Studio 2008 supports working with several different framework versions
.NET 1.0 (Initial Release)
.NET 1.1
.NET 2.0
.NET 3.0 (WPF, WF, WCF)
.NET 3.5
Topic: Configuring an Application's Target Framework
Visual Studio 2008 can target multiple versions of the .NET framework
Multi-Targeting Support
Topic: Developing and Maintaining .NET 2.0 Applications
.NET framework 2.0 applications can be developed using Visual Studio 2008
Leverage VS 2008 editor features without requiring applications to be updated to .NET 3.5
Multi-targeting support simplifies future application maintenance
Topic: Object Browser Framework Version Filtering
The Visual Studio 2008 Object Browser supports framework version filtering:
Filter by Framework Version
Demonstration: Targeting .NET framework versions with VS 2008
Your instructor will demonstrate how to:
Use the VS 2008 multi-targeting feature
Develop a .NET 2.0 project in VS 2008
Section: C# and VB.NET Language Enhancements
Language Enhancement Overview
Object Initializers
Anonymous Types
Extension Methods
How to define Extension Methods in C#
How to define Extension Methods in VB.NET
Lambda Expressions
Topic: Language Enhancement Overview
C# and VB.NET have been enhanced to reduce the amount of code that has to be written:
Object InitializersAssign values to object fields or properties without explicit constructors when the object is created
Anonymous types Compiler infers types without requiring explicit type definitions
Extension Methods Add methods to existing types without creating a derived type
Lambda Expressions
Expression used in place of a delegate to simplify coding and allow for more expressive code
Topic: Object Initializers
Object initializers allow accessible field or property values to be initialized with values without explicit constructor calls
Person p = new Person {FirstName = "John", LastName="Doe",State="AZ"};
[Visual C#]
Dim p As New Person With {.FirstName = "John", .LastName = "Doe", _.State="AZ"}
[Visual Basic]
Topic: Anonymous Types
Anonymous types allow read-only properties to be defined for an object without an explicit type definition
var p = select new {FirstName = "John", LastName="Doe"};
[Visual C#]
Dim p = New With {.FirstName = "John", .LastName = "Doe"}
[Visual Basic]
Demonstration: Using the ListView and LinqDataSource Controls
Your instructor will demonstrate how to:
Define ListView Templates
Bind a LinqDataSource Control to a Listview Control
Topic: Extension Methods
Extension methods allow existing types to be extended without creating a derived type
Extension method guidelines:
Cannot be used to override existing methods
Extension method with the same name and signature as an instance method will not be called
The concept of extension methods cannot be applied to fields, properties or events
Use extension methods sparingly
Topic: How to Define Extension Methods in C#Extension methods are defined as static methods but act like instance methods at runtime
namespace StringExtensions { public static class StringExtensionsClass { public static string RemoveNonAlphaNumeric(this string s) { MatchCollection col = Regex.Matches(s,"[A-Za-z0-9]"); StringBuilder sb = new StringBuilder(); foreach (Match m in col) sb.Append(m.Value); return sb.ToString(); } }}
Defining an Extension Method
using StringExtensions;….string phone = "123-123-1234";string newPhone = phone.RemoveNonAlphaNumeric();
Using an Extension Method
Topic: How to Define Extension Methods in VB.NET
Extension methods are defined using ExtensionAttribute
Namespace StringExtensions Module StringExtensionsModule <Extension()> _ Public Function RemoveNonAlphaNumeric(ByVal s As String) _ As String Dim col As MatchCollection = Regex.Matches(s, "[A-Za-z0-9]") Dim sb As New StringBuilder() For Each m As Match In col sb.Append(m.Value) Next Return sb.ToString() End Function End ModuleEnd Namespace
Defining an Extension Method
Imports StringExtensions….Dim phone As String = "123-564-1234"Dim newPhone as String = phone.RemoveNonAlphaNumeric()
Using an Extension Method
Topic: Lambda Expressions
A lambda expression is a function without a name that evaluates a single expression and returns its value
List<string> names = new List<string> { "John", "Jim", "Michelle" };
IEnumerable<string> filter = names.Where(p => p.StartsWith("J"));
[Visual C#]
Dim names As New List(Of String)names.Add("John")names.Add("Jim")names.Add("Michelle")Dim filter As IEnumerable(Of String) = _ names.Where(Function(p) p.StartsWith("J"))
[Visual Basic]
Demonstration: Using Language Enhancements
Your instructor will demonstrate how to:
Use object initializers, extension methods and lambda expressions
Section: Introduction to LINQ
What is LINQ?
LINQ Operators
LINQ Syntax Fundamentals
LINQ to SQL Designer
Topic: What is LINQ?LINQ = Language Integrated Query
Native C# and VB.NET language feature
Comprehensive query technology:
Reduces complexities associated with accessing data that isn't defined using OO technology
Provides static typing and compile-time syntax checking
Query Objects
Query Databases
Query XML
Query custom data stores
Topic: LINQ Operators
LINQ supports several different operations:
LINQ operators are expressed declaratively using C# or VB.NET
Visual Studio 2008 provides Intellisense support for operators
Filter
Sort
Select
Group
Join
Topic: LINQ Syntax Fundamentals
LINQ queries specify the data source to query, the filter clause and the data to select
string[ ] states = { "Arizona", "Alaska", "Utah", "Nevada" };var selectedStates = from s in states where s.StartsWith("A") select s;
[Visual C#]
Dim states As String() = { "Arizona", "Alaska", "Utah", "Nevada" }Dim selectedStates = From name In states _ Where name.StartsWith("A") _ Select name
[Visual Basic]
Topic: LINQ to SQL Designer
Visual Studio 2008 provides a LINQ to SQL designer that handles mapping relational data to CLR objects
Demonstration: Using LINQ to SQL
Your instructor will demonstrate how to:
Create a Data Context Object with the LINQ to SQL Designer
Query a Data Context Object using LINQ and Lambda Expressions
Building Web Applications with Visual Studio 2008
Overview
Design, Editing and CSS Features
New ASP.NET Controls
ASP.NET AJAX Integration
JavaScript Intellisense and Debugging
Section: Design, Editing and CSS Features
Web Development Feature Overview
Split View Support
CSS Property Windows
CSS Style Editor
CSS Intellisense
Nested Master Page Designer Support
Topic: Web Development Feature Overview
Visual Studio 2008 provides several new Web development features:
Split view mode
CSS property windows and Intellisense
Nested master page designer support
Designer support for AJAX extenders
New AJAX and Silverlight templates
Multi-targeting support
Integrated Web Application Project support
Fast switching between code view and design view
JavaScript Intellisense
Topic: Split View Support
The code editor and designer windows can be viewed together in split view mode:
Page Designer
Code Editor
Split View
Topic: CSS Property Windows
New CSS Property windows allow CSS rules and properties to be created, viewed, modified and applied
Topic: CSS Style Editor
The CSS Style Editor allows styles, classes, ID selectors and more to be created and edited visually
Inline or External Styles
Define CSS Properties
Preview Styles
Topic: Enhanced CSS Intellisense
The Visual Studio 2008 code editor provides Intellisense for CSS classes and styles
Intellisense forCSS Classes
Intellisense forInline Styles
Topic: Nested Master Page Designer Support
Nested master pages allow a child master page to be "nested" within a parent master page:
Nested master pages can be designed and edited directly in Visual Studio 2008
Master Page Child Master Page
ASP.NET Content Page
Demonstration: Using Visual Studio 2008 Web Features
Your instructor will demonstrate how to
Use the Split View Designer
Work with CSS
Section: New ASP.NET Controls
The ASP.NET ListView Control
ListView Templates
Using ListView Templates
The LinqDataSource Control
Using the LinqDataSource Control Wizard
Paging Data with the DataPager Control
Topic: The ASP.NET ListView Control
The ListView control provides a flexible way to display, modify, sort and page data in ASP.NET pages
Benefits of the ListView control:
Display, edit, insert, delete, sort, group and page data
100% control over generated HTML
Template based approach
Separate layout and item templates
Support for multiple data sources
Paging support through the DataPager control
Support for multiple key fields
Topic: ListView TemplatesThe ListView control provides several templates that can be used to control how HTML is rendered:
AlternatingItemTemplate
EditItemTemplate
EmptyDataTemplate
GroupSeparatorTemplate
GroupTemplate
InsertItemTemplate
ItemSeparatorTemplate
ItemTemplate
LayoutTemplate
SelectedItemTemplate
Topic: Using ListView TemplatesThe LayoutTemplate defines the container for data items rendered by the ItemTemplate:
<asp:ListView runat="Server" ID="lvCusts" DataSourceID="linqDataSource"ItemContainerID="itemContainer"> <LayoutTemplate> <div class="tblDetails"> <div class="floatLeftHeader">Customer ID:</div> <div class="floatRightHeader">Contact Name:</div> <div runat="server" id="itemContainer"></div> </div> </LayoutTemplate> <ItemTemplate> <div> <div class="floatLeftRow"><%#Eval("CustomerID") %></div> <div class="floatRightRow"><%#Eval("CompanyName") %></div> </div> </ItemTemplate></asp:ListView>
Topic: The LinqDataSource Control
The LinqDataSource control can bind data to ASP.NET data aware controls such as the ListView and GridView:
Query collection objects or LINQ to SQL data context objects using Language Integrated Query (LINQ)
Filter, sort, page, group, select, insert, update and delete data using LINQ
Data parameters can be defined declaratively
Provides a rich set of events to handle data operations
Visual Studio 2008 provides a LinqDataSource control wizard
Topic: Using the LinqDataSource Control Wizard
The LinqDataSource control wizard simplifies data access operations that query objects
Select Data Context Object
Filter, Sort and Modify Data
Topic: Paging Data with the DataPager ControlThe DataPager control provides numeric, next/previous and custom paging support
Paging Controls
<asp:DataPager ID="dp" runat="server" PageSize="10"> <Fields> <asp:NumericPagerField /> </Fields></asp:DataPager>
Demonstration: Using the ListView and LinqDataSource Controls
Your instructor will demonstrate how to:
Define ListView Templates
Bind a LinqDataSource Control to a Listview Control
Section: ASP.NET AJAX Integration
Integrated ASP.NET AJAX Support
ASP.NET AJAX Templates
ASP.NET AJAX Extender Control Support
Design View Support for Extender Controls
Changing Extender Control Properties
Topic: Integrated ASP.NET AJAX Support
.NET 3.5 contains integrated support for ASP.NET AJAX
System.Web.Extensions.dll installed along with the other .NET 3.5 framework assemblies
ASP.NET AJAX Extensions controls added into Toolbox
Web.config contains ASP.NET AJAX configuration entries
Topic: ASP.NET AJAX TemplatesVisual Studio 2008 provides ASP.NET AJAX templates for creating server controls and extender controls
ASP.NET AJAX Templates
Topic: ASP.NET AJAX Extender Control Support
ASP.NET AJAX extender controls can be used in ASP.NET Web applications to extend server controls
Download the ASP.NET AJAX Toolkit from http://www.codeplex.com1
Add AjaxControlToolkit.dll into your Web application's bin folder2
Using the ASP.NET AJAX Toolkit Extender Controls
Right-click the Toolbox and select Choose Items3
Select the AjaxControlToolkit.dll file from the bin folder4
Add the following Register directive to the top of the ASP.NET page:
<%@ Register TagPrefix="toolkit" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
5
Drag and drop ASP.NET AJAX Toolkit controls onto the designer 6
Topic: Design View Support for Extender Controls
Visual Studio 2008 provides design view support for ASP.NET AJAX Toolkit controls and custom extenders
Step 1: Click "Add an Extender" Step 2: Select an Extender
Topic: Accessing AJAX Extender Properties
AJAX extender control properties can be accessed through the target control's Properties window
Target Control
Extender ControlProperties
Section: JavaScript Intellisense and Debugging
JavaScript Intellisense and Syntax Validation
JavaScript Intellisense in Action
Intellisense with External JavaScript Files
Enhance JavaScript Intellisense with Comments
JavaScript Debugging Enhancements
JavaScript Debugging Windows
Topic: JavaScript Intellisense and Syntax Validation
Visual Studio 2008 provides built-in support for JavaScript Intellisense:
Visual Studio 2008 provides JavaScript syntax validation to help locate code issues
Intellisense available for inline and external JavaScript files
JavaScript comments can be used to add Intellisense hints
Type inference used to filter Intellisense options
Topic: JavaScript Intellisense in Action
Examples of JavaScript Intellisense in Visual Studio 2008
Topic: Intellisense with External JavaScript Files
Intellisense is available for external JavaScript files such as the ASP.NET AJAX script library
Topic: Enhance JavaScript Intellisense with Comments
Documentation comments can be added into JavaScript to provide Intellisense "hints"
function GetRate(base,rate) { /// <summary>Calculates desired business rate.</summary> /// <param name="base">Base amount</param> /// <param name="rate">Interest rate</param> /// <returns>number</returns> return base * rate;}
Topic: JavaScript Debugging Enhancements
Several JavaScript debugging enhancements have been added to Visual Studio 2008:
Support for breakpoints for inline script defined within an ASP.NET page
Debugging session shows a notification message to enable script debugging in IE if necessary
Support for JavaScript debugger visualizers
Script document navigation within the Solution Explorer
Rich debug windows containing detailed debugging information
Topic: JavaScript Debugging Windows
Rich debugging information can be obtained through Visual Studio 2008 debug windows
Demonstration: Working with JavaScript in Visual Studio 2008
Your instructor will demonstrate how to
Work with JavaScript Intellisense
Debug JavaScript
Building WPF, WF and WCF Applications with Visual
Studio 2008
Overview
WPF Application Development
Creating UAC Aware Applications for Windows Vista
Building WF Applications
Building WCF Applications
Section: WPF Application Development
Benefits of WPF Applications
Split View Designer Functionality
XAML Intellisense
WPF Properties Window
Hosting Windows Forms Controls in WPF Applications
WPF Deployment with ClickOnce
Using Expression Blend and VS 2008
Topic: Benefits of WPF ApplicationsWindows Presentation Foundation (WPF) applications provide several productivity and application life cycle benefits:
Integrate graphic designers into the development process
Support for control animations and transformations
Robust data binding support
Declarative XAML syntax for defining WPF controls
Interop with Windows Forms controls
Visual Studio 2008 integrated WPF designer
Desktop and browser deployment capabilities
Expression Blend provides enhanced XAML layout and animation functionality
Topic: Split View Designer
Visual Studio 2008 provides a WPF split view designer and code editor
WPF Designer
XAML Code Editor
Zoom Slider
Topic: XAML Intellisense
The XAML code editor provides full Intellisense support
Identify relevant namespaces
View valid XAML elements and attributes
Topic: WPF Properties Window
The WPF control property window provides a simplified way to locate and filter property values
Filter Properties
Direct Access to Control Name
Topic: Hosting Windows Forms Controls in WPF Applications
Windows Forms controls can be hosted within WPF applications
Existing investment in Windows Forms can be preserved while moving to WPF
Create a WPF project in Visual Studio 20081
Reference the System.Windows.Forms.dll assembly2
Host Windows Forms Controls in WPF
Reference the WindowsFormsIntegration.dll assembly3
Drag a WindowsFormHost control onto the WPF design surface4
Add XAML code within the WindowsFormsHost element to reference the Windows Forms control
5
Topic: WPF Deployment with ClickOnce
WPF applications can be deployed using ClickOnce technology:
ClickOnce is "version independent" allowing for easier application deployment now and in the future
ClickOnce is no longer reliant on CASPOL resulting in a simpler deployment model
Firefox now supported with ClickOnce and XBAP applications
Install from CD, removable drive storage, Web or network location
Offline access is available through the ClickOnce Cache
Security evaluated on application installations and on updates
Topic: Using Expression Blend and Visual Studio 2008
Expression Blend can be used by graphic designers to create WPF applications:
Visual Studio 2008 can be used by developers to complete XAML created in Expression Blend:
Define application's overall look and feel
Define control templates, styles and data templates
Create control animations and transformations
Perform advanced layout operations
XAML created by graphic designers can be modifiedby developers to add data binding, event handlers, etc.
VB.NET and C# coding
WPF application debugging and deployment
Demonstration: Creating a WPF Application
Your instructor will demonstrate how to
Use the WPF Designer
Work with WPF Controls
Section: Creating UAC Aware Applications for Windows Vista
Understanding User Access Control
Application Manifest Files
Adding Application Manifest Files in C# Projects
Adding a UAC Icon to Application Controls
Topic: Understanding User Account Control
User Account Control is a Windows Vista technology designed to improve application security
Limits applications to standard user privileges even when logged in as administrator
Prevents Malware and other malicious applications from having necessary privileges to run properly
Restricted operations (installation, write to the machine registry, event log, etc.) cause a UAC prompt to appear
Topic: Using UAC Application Manifest Files
Applications requiring elevated privileges can be compiled with an application manifest file
Application manifest file allows the application's security requirements to be defined upfront
Application manifest files requiring elevated security requirements cause a UAC shield icon to be added to the application's executable
<security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges></security>
app.manifest
Topic: Adding Application Manifest Files in C# Projects
Add a New Item into the project1
Select Application Manifest File from the templates2
Add an application manifest using Visual Studio 2008 (C# Projects)
Define the application's security requirements in the manifest file3
Access the project Properties window4
Assign the application manifest file to the Manifest setting5
Topic: Adding a UAC Icon to Application Controls
A UAC shield can be added to controls that trigger the UAC prompt in Windows Vista
UAC shield icon can be added using user32.dll features
[DllImport("user32.dll")]private static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam);uint BCM_SETSHIELD = 0x1600 + 0x000c;
…
SendMessage(new HandleRef(ButtonToEnable, ButtonToEnable.Handle), BCM_SETSHIELD, new IntPtr(0), new IntPtr(1));
[Visual C#]
Section: Building WF Applications
Introduction to Windows Workflow Foundation
New WF Features in .NET 3.5
WF Templates in Visual Studio 2008
WF Visual Studio 2008 Designer
Topic: Introduction to Windows Workflow Foundation
Windows Workflow Foundation (WF):
Framework for creating workflow-based applications
Rich collection of workflow activities
Includes workflow and rules engines
Integration with WCF services
Visual designer available in Visual Studio 2008
Topic: New WF Features in .NET 3.5
New Windows Workflow Foundation Features:
WorkflowServiceHost class for hosting workflow based services
Import and edit service contracts
WCF send and receive activities added to Toolbox
Topic: WF Templates in Visual Studio 2008
Visual Studio 2008 provides several workflow templates
Topic: WF Visual Studio 2008 Designer
Workflows can be designed visually using the Visual Studio 2008 Workflow Designer
New WCF Send/Receive Activities
Section: Building WCF Applications
Introduction to Windows Communication Foundation
New WCF Features in .NET 3.5
WCF Templates in Visual Studio 2008
Defining WCF Service Contracts
Consuming WCF Services in Visual Studio 2008
Topic: Introduction to Windows Communication Foundation
Windows Communication Foundation (WCF):
Framework for creating distributed applications that communicate using services
Service-oriented programming API
Support latest WS-* standards
Expose services over HTTP, TCP, Named Pipes, plus more
Create data and service contracts
Consume services and integrate data into .NET applications
Expose workflows as services
Topic: New WCF Features in .NET 3.5
Key New Windows Communication Foundation Features include:
Support for RSS and ATOM Syndication
XML or JSON serialization for AJAX integration
Support for additional partial trust mode scenarios
Windows Workflow Foundation Send/Receive activities
Topic: WCF Templates in Visual Studio 2008Visual Studio 2008 provides several templates for creating WCF services:
WCF Service Application
Syndication Service Library
Sequential Workflow Service Library
State Machine Workflow Service Library
WCF Service Library
Topic: Defining WCF Service Contracts
Service contracts are defined using WCF attributes and configured in web.config or app.config
[ServiceContract]public interface IEchoService{ [OperationContract] string EchoString(string value);}
[Visual C#]
<ServiceContract()> _Public Interface IEchoService <OperationContract()> _ Function EchoString(ByVal value as string) As StringEnd Interface
[Visual Basic]
Topic: Consuming WCF Services in Visual Studio 2008
Visual Studio 2008 provides integrated support for consuming services:
Add Web Reference – Consume a standard Web Service
Add Service Reference – Consume a WCF Service
Demonstration: Creating and Consuming a WCF Service
Your instructor will demonstrate how to
Create a Data Contract and Service interface
Consume a WCF Service
Visual Studio 2008 Office Development Features
Overview
Using the Office Ribbon Designer
Creating Office Task Panes
Creating Outlook Form Regions
SharePoint Workflow Designer
Deployment and Interop Features
Section: Using the Office Ribbon Designer
Benefits of the Office Ribbon Design Pattern
Understanding Ribbon Tabs and Groups
Using the Visual Studio 2008 Ribbon Designer
Ribbon Events
Using Ribbon XML
Topic: Benefits of the Office Ribbon Designer Pattern
Office 2007's ribbon design pattern provides many user interface benefits to end users:
Streamlines the process of working with Microsoft Office programs through a results oriented UI
Provides a more organized way to access application commands by using tabs rather than menus
Eliminates related features being spread across multiple menus
Topic: Understanding Ribbon Tabs and Groups
Microsoft Office ribbon commands are organized into tabs and groups
Visual Studio 2008 can be used to create custom tabs and groups
Tab
Group
Topic: Using the Visual Studio 2008 Ribbon DesignerVisual Studio 2008 supports creating and customizing Microsoft Office ribbons
Tabs, groups and controls can be customized using the ribbon designer
Topic: Ribbon Events
Ribbons expose events that can be used to perform various tasks in an Office application:
Ribbon controls expose events that can be handled to modify application functionality
Close – Called when the Office application closes the ribbon
Load – Called when the Office application loads the ribbon
LoadImage – Called when the Office ribbon loads if the ImageName property is set for one or more controls
Topic: Using Ribbon XMLMicrosoft Office ribbons can be customized using Ribbon XML in Visual Studio 2008
Ribbon XML allows tabs, groups and controls to be declaratively defined along with event handlers
<tab idMso="TabAddIns"> <group id="ContentGroup" label="Text Insertion"> <button id="textButton" label="Insert Text" screentip="Text" onAction="OnTextButton" supertip="Inserts text at the cursor location."/> <button id="tableButton" label="Insert Table" screentip="Table" onAction="OnTableButton" supertip="Inserts a table at the cursor location."/> </group></tab>
Ribbon XML
Demonstration: Creating a Custom Office Ribbon
Your instructor will demonstrate how to
Create a ribbon add-in project and adding groups and controls
Handle ribbon control events
Section: Creating Office Task Panes
Introduction to Office Task Panes
Creating Office Task Panes in Visual Studio 2008
Steps to Create a Custom Office Task Pane
Running and Debugging Task Panes
Topic: Introduction to Office Task Panes
Office Task Pane features and benefits:
Provide custom functionality in Office applications
Used consistently across entire Office product family
• Project, Excel, InfoPath, Outlook, PowerPoint, Word
• Can be created using Visual Studio 2008
Task Pane
Topic: Creating Office Task Panes in Visual Studio 2008
Custom Office Task Panes can be created using Office Add-in projects in Visual Studio 2008
Use the Visual Studio 2008 Windows Forms Designer
Task Panes are created using:
Windows Forms User Controls
Windows Forms Controls
Windows Forms Components
Topic: Steps to Create a Custom Office Task Pane
Open Microsoft Visual Studio 2008 1
Create a new project based upon your chosen language2
Create a Custom Office Task Pane
Select the Office 2007 project type3
Select an Add-in project template (Word Add-in, Excel Add-in, etc.)4
Add a User Control to the project5
Drag Windows Forms Controls onto the User Control6
Add code into the Office add-in class that creates an instance of the User Control and adds it to the CustomTaskPanes class's collection
7
Topic: Running and Debugging Task Panes
• Press the F5 key
OR
• Press the Visual Studio 2008 debug button
Run a Custom Task Pane in Visual Studio 2008
• Set one or more breakpoints in the Task Pane User Control code
• Press F5 to run the application
• Step through the User Control code
Debug a Custom Task Pane in Visual Studio 2008
Demonstration: Running and Debugging Task Panes
Your instructor will demonstrate how to
Create an Excel Add-in Project
Add an Excel Task Pane
Section: Creating Outlook Form Regions
Introduction to Outlook Form Regions
Outlook Form Region Types
Creating an Outlook Form Region
Using the Visual Studio 2008 Form Region Wizard
Running and debugging Outlook Form Regions
Topic: Introduction to Outlook Form RegionsOutlook Form Regions features and benefits:
Allow custom functionality to be added to standard Outlook 2007 forms
Leverage Windows Forms controls
Replace or enhance any standard form
Can be viewed in the main Outlook 2007 window and Reading Pane
Form Region
Topic: Outlook Form Region TypesFour different types of Outlook Form Regions exist:
Region Description
Adjoining Appends the form region to the bottom of an Outlook form's default page
ReplacementAdds the form region as a new page that replaces the default page of an Outlook form
Replace-All Replaces the whole Outlook form with the form region
Separate Adds the form region as a new page in an Outlook form
Topic: Creating an Outlook Form Region
Open Microsoft Visual Studio 2008 1
Create a new project based upon your chosen language2
Create an Outlook Form Region
Select the Office 2007 project type3
Select an Outlook Add-in project template4
Add a new Outlook Form Region item into the project5
Walk through the Form Region Wizard and select region type, display mode and standard message classes
6
Add controls to the Form Region designer7
Topic: Using the Visual Studio 2008 Form Region Wizard
Visual Studio 2008 provides an Outlook Form Region Wizard
Topic: Running and Debugging Outlook Form Regions
• Press the F5 key
OR
• Press the Visual Studio 2008 debug button
Run an Outlook Form Region in Visual Studio 2008
• Set one or more breakpoints in the Form Region code
• Press F5 to run the application
• Step through the code once the breakpoint is hit
Debug a Custom Form Region in Visual Studio 2008
Section: SharePoint Workflow Designer
Introduction to SharePoint Workflows
Accessing SharePoint Workflows in Office
Introduction to the SharePoint Workflow Designer
Topic: Introduction to SharePoint Workflows
Workflow features and benefits:
SharePoint Workflow and Office Integration:
Workflows provide a way to manage business processes in a repeatable and predictable manner
Enhance the flow of information within an enterprise
SharePoint Workflow Services can be integrated into Office applications
Office integration allows users to start workflows from the tools they work in the most
Visual Studio 2008 provides a SharePoint Workflow Designer
Visual Studio 2008 provides simplified deployment of SharePoint Workflows
Topic: Accessing SharePoint Workflows in Office
SharePoint Workflows can be accessed directly from Office applications
Topic: Introduction to the SharePoint Workflow Designer
Visual Studio 2008 provides a SharePoint Workflow Designer:
SharePoint Workflow Designer minimizes the time required to create SharePoint Workflows
Sequential and State Machine workflow templates available
Simplified debugging and deployment model
Section: Deployment and Interop Features
Deploying Office Application Add-ins
VBA and Managed Code Interoperability
Calling Managed Code from VBA
Topic: Deploying Office Application Add-ins
Office application add-ins can be deployed using the ClickOnce deployment technology:
Pre-requisites can be installed if user does not have them on their system
Rollbacks and updates are supported
Offline mode is supported when access to the installation location is not available
Topic: VBA and Manage Code Interoperability
VBA code and managed code is interoperable:
Preserves existing investment in VBA applications
Intellisense for manage assemblies and related types available within VBA code editor
.NET framework features can be used within VBA applications
VBA applications can be incrementally extended using C# or VB.NET
Topic: Calling Managed Code from VBA
Managed code can be called directly from VBA code
Intellisense for managed types is available in VBA code editor