What’s New in Visual Studio  2008
About This Clinic This 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: Architect System, service, application, data center designers Developer Code editors, visual designers, debugging, unit tests, code metrics Test Create, edit, manage and run tests Database Database 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 Initializers Assign 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, &quot;[A-Za-z0-9]&quot;)   Dim sb As New StringBuilder()   For Each m As Match In col   sb.Append(m.Value)   Next   Return sb.ToString()   End Function   End Module End Namespace Defining an Extension Method Imports StringExtensions …. Dim phone As String = &quot;123-564-1234&quot; 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> { &quot;John&quot;, &quot;Jim&quot;, &quot;Michelle&quot; }; IEnumerable<string> filter = names.Where(p => p.StartsWith(&quot;J&quot;)); [Visual C#] Dim names As New List(Of String) names.Add(&quot;John&quot;) names.Add(&quot;Jim&quot;) names.Add(&quot;Michelle&quot;) Dim filter As IEnumerable(Of String) = _   names.Where(Function(p) p.StartsWith(&quot;J&quot;)) [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 = { &quot;Arizona&quot;, &quot;Alaska&quot;, &quot;Utah&quot;, &quot;Nevada&quot; }; var selectedStates = from s in states   where s.StartsWith(&quot;A&quot;)   select s; [Visual C#] Dim states As String() = { &quot;Arizona&quot;, &quot;Alaska&quot;, &quot;Utah&quot;, &quot;Nevada&quot; } Dim selectedStates = From name In states _   Where name.StartsWith(&quot;A&quot;) _   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 for CSS Classes Intellisense for Inline Styles
Topic: Nested Master Page Designer Support Nested master pages allow a child master page to be &quot;nested&quot; 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 Templates The 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 Templates The LayoutTemplate defines the container for data items rendered by the ItemTemplate: <asp:ListView runat=&quot;Server&quot; ID=&quot;lvCusts&quot; DataSourceID=&quot;linqDataSource&quot; ItemContainerID=&quot;itemContainer&quot; >   <LayoutTemplate>   <div class=&quot;tblDetails&quot;>   <div class=&quot;floatLeftHeader&quot;>Customer ID:</div>   <div class=&quot;floatRightHeader&quot;>Contact Name:</div>   <div runat=&quot;server&quot; id=&quot;itemContainer&quot;></div>   </div>   </LayoutTemplate>   <ItemTemplate>   <div>   <div class=&quot;floatLeftRow&quot;><%#Eval(&quot;CustomerID&quot;) %></div>   <div class=&quot;floatRightRow&quot;><%#Eval(&quot;CompanyName&quot;) %></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 Control The DataPager control provides numeric, next/previous and custom paging support Paging Controls <asp:DataPager ID=&quot;dp&quot; runat=&quot;server&quot; PageSize=&quot;10&quot;>   <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 Templates Visual 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.com 1 Add AjaxControlToolkit.dll into your Web application's bin folder 2 Using the ASP.NET AJAX Toolkit Extender Controls Right-click the Toolbox and select Choose Items 3 Select the AjaxControlToolkit.dll file from the bin folder 4 Add the following Register directive to the top of the ASP.NET page: <%@ Register TagPrefix=&quot;toolkit&quot; Namespace=&quot;AjaxControlToolkit&quot;   Assembly=&quot;AjaxControlToolkit&quot; %> 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 &quot;Add an Extender&quot; 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 Control Properties
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 &quot;hints&quot; function GetRate(base,rate)  {   /// <summary>Calculates desired business rate.</summary>   /// <param name=&quot;base&quot;>Base amount</param>   /// <param name=&quot;rate&quot;>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 Applications Windows 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 2008 1 Reference the System.Windows.Forms.dll assembly 2 Host Windows Forms Controls in WPF Reference the WindowsFormsIntegration.dll assembly 3 Drag a WindowsFormHost control onto the WPF design surface 4 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 &quot;version independent&quot; 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 modified by 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=&quot;urn:schemas-microsoft-com:asm.v3&quot;>   <requestedExecutionLevel level=&quot; requireAdministrator &quot;    uiAccess=&quot;false&quot; />   </requestedPrivileges> </security> app.manifest
Topic: Adding Application Manifest Files in C# Projects Add a New Item into the project 1 Select Application Manifest File from the templates 2 Add an application manifest using Visual Studio 2008 (C# Projects) Define the application's security requirements in the manifest file 3 Access the project Properties window 4 Assign the application manifest file to the Manifest setting 5
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(&quot;user32.dll&quot;)] 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 2008 Visual 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 String End 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 Designer Visual 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 XML Microsoft 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=&quot;TabAddIns&quot;>   <group id=&quot;ContentGroup&quot; label=&quot;Text Insertion&quot;>   <button id=&quot;textButton&quot; label=&quot;Insert Text&quot;   screentip=&quot;Text&quot; onAction=&quot;OnTextButton&quot;   supertip=&quot;Inserts text at the cursor location.&quot;/>   <button id=&quot;tableButton&quot; label=&quot;Insert Table&quot;   screentip=&quot;Table&quot; onAction=&quot;OnTableButton&quot;   supertip=&quot;Inserts a table at the cursor location.&quot;/>   </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 language 2 Create a Custom Office Task Pane Select the Office    2007 project type 3 Select an Add-in project template (Word Add-in, Excel Add-in, etc.) 4 Add a User Control to the project 5 Drag Windows Forms Controls onto the User Control 6 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 Regions Outlook 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 Types Four different types of Outlook Form Regions exist: Region Description Adjoining Appends the form region to the bottom of an Outlook form's default page Replacement Adds 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 language 2 Create an Outlook Form Region Select the Office    2007 project type 3 Select an Outlook Add-in project template 4 Add a new Outlook Form Region item into the project 5 Walk through the Form Region Wizard and select region type,  display mode and standard message classes 6 Add controls to the Form Region designer 7
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

What's New in Visual Studio 2008

  • 1.
    What’s New inVisual Studio 2008
  • 2.
    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
  • 3.
    Prerequisites Experience workingwith the .NET framework Familiarity with either C# or VB.NET
  • 4.
    Clinic Outline Session1: 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
  • 5.
    Visual Studio 2008 and Language Features Overview
  • 6.
    Overview Introduction toVisual Studio 2008 .NET Framework Multi-Targeting Support C# and VB.NET Language Enhancements Introduction to Language Integrated Query (LINQ)
  • 7.
    Section: Introductionto Visual Studio 2008 Benefits of Visual Studio 2008 Visual Studio 2008 Editions Visual Studio 2008 Team Suite Functionality Visual Studio 2008 Feature Highlights
  • 8.
    Topic: Benefits ofVisual 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
  • 9.
    Topic: Visual Studio2008 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)
  • 10.
    Topic: Visual Studio2008 Team Suite Visual Studio 2008 Team Suite contains four main components: Architect System, service, application, data center designers Developer Code editors, visual designers, debugging, unit tests, code metrics Test Create, edit, manage and run tests Database Database project templates, rename refactoring, visual diff/merge, test data generation
  • 11.
    Topic: Visual Studio2008 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
  • 12.
    Section: .NETFramework Multi-Targeting Support .NET Framework Versions Configuring an Application's Target Framework Developing and Maintaining .NET 2.0 Applications Object Browser Framework Version Filtering
  • 13.
    Topic: .NET FrameworkVersions 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
  • 14.
    Topic: Configuring anApplication's Target Framework Visual Studio 2008 can target multiple versions of the .NET framework Multi-Targeting Support
  • 15.
    Topic: Developing andMaintaining .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
  • 16.
    Topic: Object BrowserFramework Version Filtering The Visual Studio 2008 Object Browser supports framework version filtering: Filter by Framework Version
  • 17.
    Demonstration: Targeting .NETframework 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
  • 18.
    Section: C# andVB.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
  • 19.
    Topic: Language EnhancementOverview C# and VB.NET have been enhanced to reduce the amount of code that has to be written: Object Initializers Assign 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
  • 20.
    Topic: Object InitializersObject initializers allow accessible field or property values to be initialized with values without explicit constructor calls Person p = new Person {FirstName = &quot;John&quot;, LastName=&quot;Doe&quot;,State=&quot;AZ&quot;}; [Visual C#] Dim p As New Person With {.FirstName = &quot;John&quot;, .LastName = &quot;Doe&quot;, _ .State=&quot;AZ&quot;} [Visual Basic]
  • 21.
    Topic: Anonymous TypesAnonymous types allow read-only properties to be defined for an object without an explicit type definition var p = select new {FirstName = &quot;John&quot;, LastName=&quot;Doe&quot;}; [Visual C#] Dim p = New With {.FirstName = &quot;John&quot;, .LastName = &quot;Doe&quot;} [Visual Basic]
  • 22.
    Demonstration: Usingthe ListView and LinqDataSource Controls Your instructor will demonstrate how to: Define ListView Templates Bind a LinqDataSource Control to a Listview Control
  • 23.
    Topic: Extension MethodsExtension 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
  • 24.
    Topic: How toDefine 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,&quot;[A-Za-z0-9]&quot;); StringBuilder sb = new StringBuilder(); foreach (Match m in col) sb.Append(m.Value); return sb.ToString(); } } } Defining an Extension Method using StringExtensions; …. string phone = &quot;123-123-1234&quot;; string newPhone = phone.RemoveNonAlphaNumeric(); Using an Extension Method
  • 25.
    Topic: How toDefine 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, &quot;[A-Za-z0-9]&quot;) Dim sb As New StringBuilder() For Each m As Match In col sb.Append(m.Value) Next Return sb.ToString() End Function End Module End Namespace Defining an Extension Method Imports StringExtensions …. Dim phone As String = &quot;123-564-1234&quot; Dim newPhone as String = phone.RemoveNonAlphaNumeric() Using an Extension Method
  • 26.
    Topic: Lambda ExpressionsA lambda expression is a function without a name that evaluates a single expression and returns its value List<string> names = new List<string> { &quot;John&quot;, &quot;Jim&quot;, &quot;Michelle&quot; }; IEnumerable<string> filter = names.Where(p => p.StartsWith(&quot;J&quot;)); [Visual C#] Dim names As New List(Of String) names.Add(&quot;John&quot;) names.Add(&quot;Jim&quot;) names.Add(&quot;Michelle&quot;) Dim filter As IEnumerable(Of String) = _ names.Where(Function(p) p.StartsWith(&quot;J&quot;)) [Visual Basic]
  • 27.
    Demonstration: UsingLanguage Enhancements Your instructor will demonstrate how to: Use object initializers, extension methods and lambda expressions
  • 28.
    Section: Introductionto LINQ What is LINQ? LINQ Operators LINQ Syntax Fundamentals LINQ to SQL Designer
  • 29.
    Topic: What isLINQ? 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
  • 30.
    Topic: LINQ OperatorsLINQ 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
  • 31.
    Topic: LINQ SyntaxFundamentals LINQ queries specify the data source to query, the filter clause and the data to select string[ ] states = { &quot;Arizona&quot;, &quot;Alaska&quot;, &quot;Utah&quot;, &quot;Nevada&quot; }; var selectedStates = from s in states where s.StartsWith(&quot;A&quot;) select s; [Visual C#] Dim states As String() = { &quot;Arizona&quot;, &quot;Alaska&quot;, &quot;Utah&quot;, &quot;Nevada&quot; } Dim selectedStates = From name In states _ Where name.StartsWith(&quot;A&quot;) _ Select name [Visual Basic]
  • 32.
    Topic: LINQ toSQL Designer Visual Studio 2008 provides a LINQ to SQL designer that handles mapping relational data to CLR objects
  • 33.
    Demonstration: Using LINQto 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
  • 34.
    Building Web Applicationswith Visual Studio 2008
  • 35.
    Overview Design, Editingand CSS Features New ASP.NET Controls ASP.NET AJAX Integration JavaScript Intellisense and Debugging
  • 36.
    Section: Design, Editingand CSS Features Web Development Feature Overview Split View Support CSS Property Windows CSS Style Editor CSS Intellisense Nested Master Page Designer Support
  • 37.
    Topic: Web DevelopmentFeature 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
  • 38.
    Topic: Split ViewSupport The code editor and designer windows can be viewed together in split view mode: Page Designer Code Editor Split View
  • 39.
    Topic: CSS PropertyWindows New CSS Property windows allow CSS rules and properties to be created, viewed, modified and applied
  • 40.
    Topic: CSS StyleEditor 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
  • 41.
    Topic: Enhanced CSSIntellisense The Visual Studio 2008 code editor provides Intellisense for CSS classes and styles Intellisense for CSS Classes Intellisense for Inline Styles
  • 42.
    Topic: Nested MasterPage Designer Support Nested master pages allow a child master page to be &quot;nested&quot; 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
  • 43.
    Demonstration: Using VisualStudio 2008 Web Features Your instructor will demonstrate how to Use the Split View Designer Work with CSS
  • 44.
    Section: NewASP.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
  • 45.
    Topic: The ASP.NETListView 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
  • 46.
    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
  • 47.
    Topic: Using ListViewTemplates The LayoutTemplate defines the container for data items rendered by the ItemTemplate: <asp:ListView runat=&quot;Server&quot; ID=&quot;lvCusts&quot; DataSourceID=&quot;linqDataSource&quot; ItemContainerID=&quot;itemContainer&quot; > <LayoutTemplate> <div class=&quot;tblDetails&quot;> <div class=&quot;floatLeftHeader&quot;>Customer ID:</div> <div class=&quot;floatRightHeader&quot;>Contact Name:</div> <div runat=&quot;server&quot; id=&quot;itemContainer&quot;></div> </div> </LayoutTemplate> <ItemTemplate> <div> <div class=&quot;floatLeftRow&quot;><%#Eval(&quot;CustomerID&quot;) %></div> <div class=&quot;floatRightRow&quot;><%#Eval(&quot;CompanyName&quot;) %></div> </div> </ItemTemplate> </asp:ListView>
  • 48.
    Topic: The LinqDataSourceControl 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
  • 49.
    Topic: Using theLinqDataSource Control Wizard The LinqDataSource control wizard simplifies data access operations that query objects Select Data Context Object Filter, Sort and Modify Data
  • 50.
    Topic: Paging Datawith the DataPager Control The DataPager control provides numeric, next/previous and custom paging support Paging Controls <asp:DataPager ID=&quot;dp&quot; runat=&quot;server&quot; PageSize=&quot;10&quot;> <Fields> <asp:NumericPagerField /> </Fields> </asp:DataPager>
  • 51.
    Demonstration: Usingthe ListView and LinqDataSource Controls Your instructor will demonstrate how to: Define ListView Templates Bind a LinqDataSource Control to a Listview Control
  • 52.
    Section: ASP.NET AJAXIntegration 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
  • 53.
    Topic: Integrated ASP.NETAJAX 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
  • 54.
    Topic: ASP.NET AJAXTemplates Visual Studio 2008 provides ASP.NET AJAX templates for creating server controls and extender controls ASP.NET AJAX Templates
  • 55.
    Topic: ASP.NET AJAXExtender 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.com 1 Add AjaxControlToolkit.dll into your Web application's bin folder 2 Using the ASP.NET AJAX Toolkit Extender Controls Right-click the Toolbox and select Choose Items 3 Select the AjaxControlToolkit.dll file from the bin folder 4 Add the following Register directive to the top of the ASP.NET page: <%@ Register TagPrefix=&quot;toolkit&quot; Namespace=&quot;AjaxControlToolkit&quot; Assembly=&quot;AjaxControlToolkit&quot; %> 5 Drag and drop ASP.NET AJAX Toolkit controls onto the designer 6
  • 56.
    Topic: Design ViewSupport for Extender Controls Visual Studio 2008 provides design view support for ASP.NET AJAX Toolkit controls and custom extenders Step 1: Click &quot;Add an Extender&quot; Step 2: Select an Extender
  • 57.
    Topic: Accessing AJAXExtender Properties AJAX extender control properties can be accessed through the target control's Properties window Target Control Extender Control Properties
  • 58.
    Section: JavaScript Intellisenseand 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
  • 59.
    Topic: JavaScript Intellisenseand 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
  • 60.
    Topic: JavaScript Intellisensein Action Examples of JavaScript Intellisense in Visual Studio 2008
  • 61.
    Topic: Intellisense withExternal JavaScript Files Intellisense is available for external JavaScript files such as the ASP.NET AJAX script library
  • 62.
    Topic: Enhance JavaScriptIntellisense with Comments Documentation comments can be added into JavaScript to provide Intellisense &quot;hints&quot; function GetRate(base,rate) { /// <summary>Calculates desired business rate.</summary> /// <param name=&quot;base&quot;>Base amount</param> /// <param name=&quot;rate&quot;>Interest rate</param> /// <returns>number</returns> return base * rate; }
  • 63.
    Topic: JavaScript DebuggingEnhancements 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
  • 64.
    Topic: JavaScript DebuggingWindows Rich debugging information can be obtained through Visual Studio 2008 debug windows
  • 65.
    Demonstration: Working withJavaScript in Visual Studio 2008 Your instructor will demonstrate how to Work with JavaScript Intellisense Debug JavaScript
  • 66.
    Building WPF, WFand WCF Applications with Visual Studio 2008
  • 67.
    Overview WPF ApplicationDevelopment Creating UAC Aware Applications for Windows Vista Building WF Applications Building WCF Applications
  • 68.
    Section: WPFApplication 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
  • 69.
    Topic: Benefits ofWPF Applications Windows 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
  • 70.
    Topic: Split ViewDesigner Visual Studio 2008 provides a WPF split view designer and code editor WPF Designer XAML Code Editor Zoom Slider
  • 71.
    Topic: XAML IntellisenseThe XAML code editor provides full Intellisense support Identify relevant namespaces View valid XAML elements and attributes
  • 72.
    Topic: WPF PropertiesWindow The WPF control property window provides a simplified way to locate and filter property values Filter Properties Direct Access to Control Name
  • 73.
    Topic: Hosting WindowsForms 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 2008 1 Reference the System.Windows.Forms.dll assembly 2 Host Windows Forms Controls in WPF Reference the WindowsFormsIntegration.dll assembly 3 Drag a WindowsFormHost control onto the WPF design surface 4 Add XAML code within the WindowsFormsHost element to reference the Windows Forms control 5
  • 74.
    Topic: WPF Deploymentwith ClickOnce WPF applications can be deployed using ClickOnce technology: ClickOnce is &quot;version independent&quot; 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
  • 75.
    Topic: Using ExpressionBlend 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 modified by developers to add data binding, event handlers, etc. VB.NET and C# coding WPF application debugging and deployment
  • 76.
    Demonstration: Creating aWPF Application Your instructor will demonstrate how to Use the WPF Designer Work with WPF Controls
  • 77.
    Section: Creating UACAware 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
  • 78.
    Topic: Understanding UserAccount 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
  • 79.
    Topic: Using UACApplication 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=&quot;urn:schemas-microsoft-com:asm.v3&quot;> <requestedExecutionLevel level=&quot; requireAdministrator &quot; uiAccess=&quot;false&quot; /> </requestedPrivileges> </security> app.manifest
  • 80.
    Topic: Adding ApplicationManifest Files in C# Projects Add a New Item into the project 1 Select Application Manifest File from the templates 2 Add an application manifest using Visual Studio 2008 (C# Projects) Define the application's security requirements in the manifest file 3 Access the project Properties window 4 Assign the application manifest file to the Manifest setting 5
  • 81.
    Topic: Adding aUAC 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(&quot;user32.dll&quot;)] 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#]
  • 82.
    Section: Building WFApplications Introduction to Windows Workflow Foundation New WF Features in .NET 3.5 WF Templates in Visual Studio 2008 WF Visual Studio 2008 Designer
  • 83.
    Topic: Introduction toWindows 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
  • 84.
    Topic: New WFFeatures 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
  • 85.
    Topic: WF Templatesin Visual Studio 2008 Visual Studio 2008 provides several workflow templates
  • 86.
    Topic: WF VisualStudio 2008 Designer Workflows can be designed visually using the Visual Studio 2008 Workflow Designer New WCF Send/Receive Activities
  • 87.
    Section: Building WCFApplications 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
  • 88.
    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
  • 89.
    Topic: New WCFFeatures 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
  • 90.
    Topic: WCF Templates in Visual Studio 2008 Visual 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
  • 91.
    Topic: Defining WCFService 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 String End Interface [Visual Basic]
  • 92.
    Topic: Consuming WCFServices 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
  • 93.
    Demonstration: Creating andConsuming a WCF Service Your instructor will demonstrate how to Create a Data Contract and Service interface Consume a WCF Service
  • 94.
    Visual Studio 2008 Office Development Features
  • 95.
    Overview Using theOffice Ribbon Designer Creating Office Task Panes Creating Outlook Form Regions SharePoint Workflow Designer Deployment and Interop Features
  • 96.
    Section: Using theOffice 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
  • 97.
    Topic: Benefits ofthe 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
  • 98.
    Topic: Understanding RibbonTabs 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
  • 99.
    Topic: Using theVisual Studio 2008 Ribbon Designer Visual Studio 2008 supports creating and customizing Microsoft Office ribbons Tabs, groups and controls can be customized using the ribbon designer
  • 100.
    Topic: Ribbon EventsRibbons 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
  • 101.
    Topic: Using RibbonXML Microsoft 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=&quot;TabAddIns&quot;> <group id=&quot;ContentGroup&quot; label=&quot;Text Insertion&quot;> <button id=&quot;textButton&quot; label=&quot;Insert Text&quot; screentip=&quot;Text&quot; onAction=&quot;OnTextButton&quot; supertip=&quot;Inserts text at the cursor location.&quot;/> <button id=&quot;tableButton&quot; label=&quot;Insert Table&quot; screentip=&quot;Table&quot; onAction=&quot;OnTableButton&quot; supertip=&quot;Inserts a table at the cursor location.&quot;/> </group> </tab> Ribbon XML
  • 102.
    Demonstration: Creating aCustom Office Ribbon Your instructor will demonstrate how to Create a ribbon add-in project and adding groups and controls Handle ribbon control events
  • 103.
    Section: CreatingOffice 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
  • 104.
    Topic: Introduction toOffice 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
  • 105.
    Topic: Creating OfficeTask 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
  • 106.
    Topic: Steps toCreate a Custom Office Task Pane Open Microsoft Visual Studio 2008 1 Create a new project based upon your chosen language 2 Create a Custom Office Task Pane Select the Office  2007 project type 3 Select an Add-in project template (Word Add-in, Excel Add-in, etc.) 4 Add a User Control to the project 5 Drag Windows Forms Controls onto the User Control 6 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
  • 107.
    Topic: Running andDebugging 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
  • 108.
    Demonstration: Running andDebugging Task Panes Your instructor will demonstrate how to Create an Excel Add-in Project Add an Excel Task Pane
  • 109.
    Section: Creating OutlookForm 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
  • 110.
    Topic: Introduction toOutlook Form Regions Outlook 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
  • 111.
    Topic: Outlook FormRegion Types Four different types of Outlook Form Regions exist: Region Description Adjoining Appends the form region to the bottom of an Outlook form's default page Replacement Adds 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
  • 112.
    Topic: Creating anOutlook Form Region Open Microsoft Visual Studio 2008 1 Create a new project based upon your chosen language 2 Create an Outlook Form Region Select the Office  2007 project type 3 Select an Outlook Add-in project template 4 Add a new Outlook Form Region item into the project 5 Walk through the Form Region Wizard and select region type, display mode and standard message classes 6 Add controls to the Form Region designer 7
  • 113.
    Topic: Using theVisual Studio 2008 Form Region Wizard Visual Studio 2008 provides an Outlook Form Region Wizard
  • 114.
    Topic: Running andDebugging 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
  • 115.
    Section: SharePointWorkflow Designer Introduction to SharePoint Workflows Accessing SharePoint Workflows in Office Introduction to the SharePoint Workflow Designer
  • 116.
    Topic: Introduction toSharePoint 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
  • 117.
    Topic: Accessing SharePointWorkflows in Office SharePoint Workflows can be accessed directly from Office applications
  • 118.
    Topic: Introduction tothe 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
  • 119.
    Section: Deploymentand Interop Features Deploying Office Application Add-ins VBA and Managed Code Interoperability Calling Managed Code from VBA
  • 120.
    Topic: Deploying OfficeApplication 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
  • 121.
    Topic: VBA andManage 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
  • 122.
    Topic: Calling ManagedCode from VBA Managed code can be called directly from VBA code Intellisense for managed types is available in VBA code editor