19 – 21 march 2006 riyadh, saudi arabia. smart client development, how to make applications go...

40
19 – 21 MARCH 2006 Riyadh, Saudi Arabia

Upload: joanna-baker

Post on 18-Jan-2018

214 views

Category:

Documents


0 download

DESCRIPTION

Agenda Smart Clients Tools ToolStrips Custom renderers, colors, items DataGridView Custom painting, formatting, column types BackgroundWorker Cancellation, progress updates, responsive UI TableLayoutPanel Dynamic layout, content Scenarios

TRANSCRIPT

Page 1: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

19 – 21 MARCH 2006 Riyadh, Saudi Arabia

Page 2: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Smart Client Development, How to make applications go smarter with VS2005

Goksin Bakir

Yage Ltd,

Microsoft Regional Director, MEA

Page 3: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Agenda

Smart Clients

ToolsToolStrips

Custom renderers, colors, items

DataGridViewCustom painting, formatting, column types

BackgroundWorkerCancellation, progress updates, responsive UI

TableLayoutPanelDynamic layout, content

Scenarios

Page 4: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Smart Client

Tough Tough to deployto deploy

HeavyHeavyfootprintfootprint

““DLLDLLHell”Hell”

NetworkNetworkdependencydependency

ReducedReduced User User

ExperienceExperience

Complex toComplex todevelopdevelop

Web servicesWeb servicesand offline/onlineand offline/online

supportsupport

DeviceDeviceadaptabilityadaptability

Broad reachBroad reach

Easy changeEasy changemanagementmanagement

Easy toEasy todeploydeploy

Rich UserRich UserExperienceExperience

High developerHigh developerproductivityproductivity

ResponsiveResponsiveUIUI

Page 5: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Smart Client Features

Local resourcesDirect display and peripheral access

Responsive graphics, printers, digital camera’s, etc.

Use of installed applicationsWord, Excel, VSTO

ConnectedAccess to network resources

Web services, SQL Databases

Page 6: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Smart Client Features

Offline capableCache online data

Update when connected

Datasets in smart documents

Intelligent deployment and updateEasy non-administrator deployment

Automatic updates

Smart document deployment

Rich / easy developer experience

Page 7: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Smart Client Technologies

Visual Studio 2005Rich visual designer support

Integrated ClickOnce testing and deployment

Visual Studio Tools for Office

.NET Framework 2.0Windows Forms 2.0

ClickOnce deployment

Page 8: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Visual Studio 2005

Project templatesGet up and going quickly

Common application types

DesignersSimplifies development of UI and layout

Rich User Control development

Rich support for Custom Controls

Page 9: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

What is “smart”

Local resources and user experience

Offline capable

Intelligent deployment and update

Multithreaded

Crash Proof

Page 10: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional
Page 11: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Visual Studio 2005

DataNew data-bound controls

Schema-based typed-data set designerSupport for iterative maintenance of generated data-code

Partial types for maintainable customizations of auto-generated code

Reduced need for “mapping” or “glue” code

Server explorerIntegrated data manipulation

Page 12: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional
Page 13: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

ClickOnce Deployment

ClickOnce application deployment published on a web or file server

Client follows link to serverhttp://www.tempuri.org/my.application

Application deployed locally in user’s profile directory & executed

Subsequent executions check for updates & execute local install

Server

Client

application filesapplication files

Page 14: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

ClickOnce

Smart Client deployment technology

Provides web-deployment simplicityEnd User

Provide web-deployment flexibilityPublisher

Other parallels to web-applicationsApplications are isolated per-userCan be executed with limited local permissions

Locally executed, rich features

Page 15: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

ClickOnce Features

Follow a link to install an applicationAutomatic w/minimal or no decision points

web-style deployment

Automatic update of application

Security isolation and optional restricted permissions

Non-administrative installs

Page 16: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

ClickOnce & VS 2005

Project Settings Publish tabSet deployment location

Configure data files for deployment

Other settings: version, online-only or online-offline, CD installations and other details

Project Settings Security tabCalculating permissions required by your application to function

Also add permissions using SecurityException at runtime

Setting permissions in the manifest required to run

Partial trust and full trust supported

Page 17: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Application Updates

Auto-update deployment optionsBefore application launch, or

Update check occurs after app-launch

Scheduled update checksWeekly, monthly, etc.

Project Settings Publish tabSettings for update checking

Page 18: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

ToolStrips

Replaces MainMenu, ContextMenu, ToolBar and StatusBar

HWNDless architecture

Same OM across all containers

System and professional renderers

ToolStripControlHost

Page 19: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Datagridview

Replaces DataGrid

Extensible and FlexibleBound, Unbound, Virtual, Mixed

Eleventy billion PMEs

Text, Image, Button, Link cells/columns

Cell-based, not Column-basedCell styles (Font, Color, Formatting)

Cell-level eventsMouse, Formatting, Validate, Error, others...

Custom Column Types

High performanceDisplay, scrolling, updates

Page 20: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Backgroundworker

BackgroundWorkerSimplify creating responsive applications

Easier to perform long running tasks without “freezing” the UI

Simplify Thread use in Windows Forms applications

Page 21: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Automatically acquired ThreadPool Thread

no UI updates allowed…

UI Thread

DoWork(){DoWork(){ If (!CancellationPending){If (!CancellationPending){ FindInFiles()FindInFiles() }}}}

StartFindInFiles()StartFindInFiles()

ProgressChanged(){ProgressChanged(){ Update UIUpdate UI}}

RunWorkerCompleted()RunWorkerCompleted()

EndFindInFiles()EndFindInFiles()

RunWorkerAsync()RunWorkerAsync()

ReportProgress()ReportProgress()

Diagram: BackgroundWorker

Page 22: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Tablelayoutpanel

Layout ControlsTableLayoutPanel

Similar to HTML Table control

Address localization scenarios

Facilitate creation of resizable UI

Support data-driven UI (e.g., labels from a DB)

Page 23: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Diagram: Login Dialog

Equal %, preserve Equal %, preserve minimum size, lower minimum size, lower

right alignmentright alignment

Only occupy Only occupy necessary necessary

spacespace

Right aligned, Right aligned, Grow/Shrink to Grow/Shrink to

accommodate label accommodate label lengthlength

AutoScaleAutoScale

RightToLeftRightToLeft

Font ChangesFont Changes

DPI ChangesDPI Changes

Page 24: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

DEMO

Page 25: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

What Is: Occasionally Connected

Empowering users to leverage their computer, applications, data and files regardless of network availability

Application proactively retrieves necessary data necessary to work offline

As the network comes available, the application will automatically sync their work and log conflicts for the user to resolve

Network operations occur in the background so the user can stay focused on their task

Example: Outlook 2003

Page 26: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Resources Needed Offline

DataA subset of the data from the server(s)

Heterogeneous Sync (SQL Server, Oracle, DB2, …)

FilesNot all data exists within the database

Media files, Office Files, …

Application Messaging (Web Services, WCF, …)Ability to queue outbound messages

Ability to async process inbound messages

Read Only Informational/Reference Data ServicesAbility to pre-fetch data from existing services

Page 27: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Occasionally Connected Smart ClientOccasionally Connected Smart Client

Background Background TasksTasks

Net

wor

k Re

sour

ces

Net

wor

k Re

sour

ces Data SyncData Sync

ServicesServices

Data Access APIData Access API

Data StoreData Store

Message Message QueuingQueuing

Message Message CachingCaching

FilesFiles

File SyncFile SyncServicesServices

Microsoft Windows / Windows MobileMicrosoft Windows / Windows Mobile

Visu

al S

tudi

oVi

sual

Stu

dio

Smart Client Application / UISmart Client Application / UI

Application Application UpdatesUpdates

Canned Canned UI UI

ControlsControls

Page 28: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

SalesSalesSmart ClientSmart Client

Background Background TasksTasks

Works CorpWorks Corp

Architecture

Net

wor

k Se

rvic

esN

etw

ork

Serv

ices

SyncSyncServicesServices

Data StoreData Store

WeatherWeatherCachingCaching

Order Order SubmissioSubmission Queuen Queue PromoPromo

VideosVideos

App LogicApp Logic

Desktop Desktop TabletPTabletP

CCPocketPCPocketPC Smart Smart

PhonePhone

DataDataServerServer

Sync

Sync

Serv

icSe

rvic

eses

Ord

erO

rder

Serv

icSe

rvic

eses

WeatheWeatherr

ServiceServicess

•Product Catalog•My Customers•Order Scratchpad•My Inventory

App App UpdatesUpdates

Page 29: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Which Local Data Store?

Microsoft Database Technologies

SQL Server 2005SQL Server Express Edition

SQL Server Mobile Edition

Jet (Access)

Microsoft Visual FoxPro (.dbf)

Excel

XML

WinFS

Something new

Page 30: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

SQL Server Express

Great improvements over MSDESimple install from web or local MSI

ClickOnce will BootStrap SSE if not installed

Connect w/File Path Connection StringUser Instance feature for File Path Connecitons

Great for VS Development

Page 31: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Deploying SSE For Occasionally Connected Scenarios

Base Install of SSEClickOnce BootstrapperRequires Admin Rights

Replication w/SSEReplication not supported w/User Instances

Enable SQL Server AuthenticationAdd DBO Privileged AccountScript creation of databaseVerify / Create / Attach database at startup

Deploy SQL Server Replication .Dlls

Page 32: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Occasionally Connected Devices

Servers

Desktops

Laptops

Tablet PC’s

Windows CE

Pocket PC

Smart Phone

??Win 32Win 32 Sweet Sweet

spotspot

Page 33: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Local Database Options

ServerWorkgroup

DesktopLaptop

Tablet PCWindows CE Device

Pocket PCSmart Phone

Win 32Win 32

SQ

L S

erve

rE

xpre

ss

SQ

LS

erve

rM

ulti

Use

rS

ingl

e U

ser S

cena

rios

SQ

L M

obile

S

QL

Mob

ile

Page 34: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Deploying SQL Server Mobile

SQL Server Mobile EngineAdd runtime dlls to project (sqlce*.dll) C:\Program Files\Microsoft Visual Studio 8\Common7\IDE

File size <1.4mb

Set files to Copy to Output Directory = Copy if newer

ADO for SQL Server MobileAdd reference to Microsoft SQL Mobile

Located in: C:\Program Files\Microsoft Visual Studio 8\ _ Common7\IDE\PublicAssemblies\System.Data.SqlServerCE.dll

File Size ~224k

Page 35: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

How - To Sync

Roll your ownUltimate in flexibilityHighest cost to develop and maintain

Merge ReplicationMost power, broadest features for different data partitions, spans all devicesNeed DBO/DBA privileges, must “own” server

Remote Data Access (RDA)Easy entry point for well partitioned data, no config to databaseLimited to SQL Server Mobile

Technology Roll your ownMerge

Replication

RemoteData Access

XML - DataSets SQL Server Express SQL Server Mobile

Page 36: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Local App

RDA Sync Architecture

Server Data

SQL ServerMobile

Database Engine

DAL

UI

InInOutOut

IISw / Sync ISAPI dll

RDA Sync Engine

Page 37: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

BackgroundTasks / Steps

Runs on a background thread of the application

Executes collection of steps

Start / Stop similar to Windows Services

Executes in a loop based on a Timer

Can be triggered by Network Resources

Marshals progress / completed infoto UI thread

Page 38: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional
Page 39: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Community Resources

INETA MEA ! www.ineta.org

mea.ineta.org

Page 40: 19 – 21 MARCH 2006 Riyadh, Saudi Arabia. Smart Client Development, How to make applications go smarter with VS2005 Goksin Bakir Yage Ltd, Microsoft Regional

Smart Client Summary

Rich features easier than ever to implementWindows Forms 2.0 new controls

Windows Forms 2.0 improved data integration

Installation and update easier than everClickOnce web-style simplicity

ClickOnce web-style security

SmartClient rich feature-set

Customers access existing and new application features easily

Customers access your application with or without network connectivity