Friday, December 18, 2009

Using the Built-in Silverlight Media Player of SharePoint 2010

This summary is not available. Please click here to view the post.

Friday, December 11, 2009

Dialog Platform in SharePoint 2010 & How to open the Edit Form Dialog for List Item


Dialog Platform in SharePoint 2010:

One of the New User Interface Platforms in SharePoint 2010 is ‘The Dialog Platform
A dialog is essentially a <div> which gets visible on demand and renders the HTML using a background overlay creating a modal dialog like user experience.

We can show an existing div from within the page or a different page using a URL inside the dialogs.
When we pass the URL to the dialog it looks for the Querystring parameter “IsDlg=1”. If this parameters exists than it would dynamically load the "/_layouts/styles/dlgframe.css” file. This file overrides the “s4-notdlg” class items as “display:none”, which means that all items with this class would not get displayed in Dialog Mode. 
So if we go to the v4.master page we can see that this class is used by the Ribbon control to hide the ribbon when in dialog mode:

image 

How to open the Edit Form Dialog for List Item:


In SharePoint 2010 The URL for opening the Edit Form of any list item looks like something like this :

”http://intranet.contoso.com/<SiteName>/Lists/<ListName>/EditForm.aspx?ID=1&IsDlg=1”

ID
is the list item row identifier and as discussed above the IsDlg is for the dialog mode.

Now to open a dialog we need to use the SP.UI.ModalDialog.showModalDialog method from the ECMAScript Client Object model and pass in the url of the page, width & height of the dialog and also a callback function in case we want some code to run after the dialog is closed.

<script type="text/javascript">
//Handle the DialogCallback callback
function DialogCallback(dialogResult, returnValue){
}

//Open the Dialog
function OpenEditDialog(id){
var options = {
url:&quot;http://intranet.contoso.com/<SiteName>/Lists/<ListName>/EditForm.aspx?ID=&quot; + id + &quot;&amp;IsDlg=1&quot;,
width: 700,
height: 700,
dialogReturnValueCallback: DialogCallback
};
SP.UI.ModalDialog.showModalDialog(options);
}
</script>


The .js files for the ECMAScript Object Model (SP.js, SP.Core.js, SP.Ribbon.js, and SP.Runtime.js ) are installed in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS directory.


Here is a good MSDN link explaining the Client Object Model Distribution and Deployment options available in SharePoint 2010.

Sunday, November 29, 2009

Summary of all PDC09 – Announcements / Product Features / Cool Stuff

 

Silverlight

  • Silverlight 4.0 Features & More:
    • Support for Webcam, Microphones, Right Click, Mouse Wheel
    • New Rich Text control
    • Clipboard Access
    • Print Preview Dialogs
    • Authorization support in Client HTTP Stack (NTLM, Basic, Digest)
    • Running outside sandbox for Trusted Out of browser applications
      • HTML rendering control inside Silverlight
      • Local file system access
      • Keyboard in full screen
      • COM automation support (read word/excel files)
      • Notification Popups
  • Screen Presentation Framework (MVVM + Prism) for Silverlight
  • Silverlight Media Framework - Smooth Streaming Porting Kit
  • Microsoft XAML Toolkit : Provides Static Analysis, Localization, & XamlDom for .NET/Silverlight XAML
  • ADO.NET Data Services is now “OData”  - Open Data Protocol & WCF Data Services 
  • .NET 4 Location API - Installed by default with .NET 4 and supported in Visual Studio 2010. (System.Device.dll) See WHDC site for Sensors/Location : www.microsoft.com/WHDC/Sensors
  • Bing Maps Silverlight Control
  • Advanced Performance & Profiling in Silverlight 4
  • WCF RIA Services for Silverlight

SharePoint

Windows Azure

  • Windows Azure + Windows Identity Foundation + ADFS2 : https://federatedidentity.cloudapp.net/
  • Windows Azure Platform AppFabric - provides secure connectivity as a service to help developers bridge cloud, on-premises, and hosted deployments
  • Velocity is now “Windows Server AppFabric Caching
  • Dublin is now  “Windows Server AppFabric” - The Windows Server AppFabric supports WCF and Workflow services by:
    • Providing runtime databases
    • Capabilities for monitoring, persistence, hosting and caching
    • Tooling and scripting to manage and monitor WCF and WF services
  • Windows Azure :
    • Features
      • Blobs – Provide a simple interface for storing named files along with metadata for the file
      • New Type - Page Blob
      • New Operations – Updated, Copy, Snapshot, Lease Blob
      • New Ways of Accessing and Service Blob Content -
        • Custom Domain Names
        • Root Blob Container
        • Content Delivery Network access
        • Shared Access Signatures
      • Entity Group Transactions - Atomically perform multiple insert/update/delete
        over entities in same partition in a single transaction
      • Dequeue count returned with message
    • Futures
      • Administrator privileges in the VM
      • Deployment of pre-configured VM images
      • User-selectable geo-locations for replicas
      • Secondary indices on tables
      • New storage option “Drives” - Provides durable NTFS volumes for Windows Azure applications to use (Feb 2010)
      • Remote terminal server access to VMs
      • Microsoft Sync Framework and ADO.NET Sync Services - Tools for data synchronization with SQL Azure
  • TCO and ROI Calculator - provides a customized estimate of potential cost savings you (or your company or organization) may achieve by building on the Windows Azure Platform
  • Windows Azure Diagnostics - SDK component providing distributed monitoring & data collection for cloud apps
  • Visual Studio 2010 RTM and SQL Azure Futures:
    • Connect to SQL Azure – Data | Add New Data Source (DataSet & EDM)
    • EDM Conceptual Data Modeling Designer – Generate database
    • Server Explorer – Browse
    • Data Sources Window (DataSet, EDM, LinqToSQL, data binding tools)
    • Configure SQL Data Source
  • File Classification Infrastructure (FCI) - provides many avenues to be part of end-to-end data lifecycle management solutions
  • Houston- Project Houston will provide a easy to use cloud based database development experience
  • Access Control Service - claims based access control for REST web services
    • Implements OAuth Web Resource Authorization Protocol (WRAP) & Simple Web Tokens (SWT)
    • Integrates with AD FS v2

Surface & Windows 7

  • Multitouch on Windows 7
    • Manipulation Events
    • ScrollViewer Panning Support
    • WPF Controls Styles with Panning Enabled
    • Multi-Touch on the web with Silverlight
      • Manipulation and Inertia Process API
  • Windows API Code Pack – Managed Class Library to access to Windows (7) features
  • Surface Toolkit for Windows Touch” – Would be coming shortly after the WPF4 Launch
  • Surface Futures:
    • Cheaper
    • Thinner
    • Vertical
  • Surface SDK & Resources now available free

Visual Studio, WCF, WPF

  • WCF 4.0 Features:
    • Default Endpoints, Protocol Mapping, Binding Configurations,Behavior Configurations
    • File-less Activation (no .svc)
    • Simple Ad-hoc Service Discovery
    • Service Announcements
    • Routing Service
    • Message Filters and Content-based Routing
    • Automatic Help Page
    • HTTP Caching Support
  • WPF 4.0 New Features: Here is an excellent blog series from Lester covering all the below features with sample code:
    • MultiTouch
    • DatePicker\Calendar
    • Datagrid
    • Visual State Manager (VSM)
    • Easing Functions
    • JumpLists
    • Pixel Shader 3 support
    • Cached Composition
    • Full trust Xbap Deployment
    • Binding to Dynamic Objects
    • Custom Speller Support
    • Script Interop in Xbap
    • UIA Virtualization
    • UIA SynchronizedInputPattern
    • Input Key\Gesture Binding
    • TextFormattingMode
    • CaretBrush
    • SelectionBrush
    • Bindable Run
    • ClearTypeHint
    • LayoutRounding
    • Updated File Dialogs
  • Manycore & .NET 4.0 with Visual Studio 2010 (Concurrency):
    • ThreadPool.QueueUserWorkItem
    • System.Threading.Tasks.Task + System.Collections.Concurrent
    • New Sync Primitives in .NET 4
    • Visual Studio 2010 Concurrency Profiler Views + Parallel Debugger Toolwindow
  • Visual Studio 2010 ExtensibilityExtensions Gallery & VSX Samples

ASP.net & SQL Server

Microsoft Research & Labs

  • Infer.NET - framework for running Bayesian inference in graphical models (from MSR)
  • Axum” : A .NET Language for Safe and Scalable Concurrency
  • Holmes” - Automated Statistical Debugging using Path Profiles (from MSR)
  • Darwin” - An Approach for Debugging Software Regressions (from MSR)
  • Project Trident” - A Scientific Workflow Workbench (from MSR)
  • Pivot” by Live Labs : Visualizing collections of objects, Revealing hidden patterns within data, Acting on discovered insights
  • DevLabs: Reactive Extensions for .NET (Rx)
  • Trustworthy Data Collaboration SQL Azure Codename ‘Vidalia’
  • Microsoft Codename “Dallas” - Content Brokerage and Discovery platform

Other

Thursday, November 19, 2009

@PDC09 – Day 3 – Developing custom applications in SharePoint 2010 using ASP.net, WCF, REST


SharePoint Web Services

  • REST
  • Client Object Model
  • ASP.net
  • WCF

REST

  • Access to sharepoint lists and library data ( …/_vti_bin/listdata.svc)
  • Lists and List items map to resources (listdata.svc/Employees(123) )
  • Operation are mapped with HTTP verbs (GET, POST . . )
  • Based on ADO.net Data Services
    • Flexible URL conventions for querying data
      • listdata.svc/Employees?$filder=JobTitle eq ‘SDE’
      • $orderby=Fullname
    • Multiple representations
      • JSON and Atom (full AtomPub support)
    • Batching, ETags, Paging, Documents

Demo . . .
REST query is converted to CAML query…..

Integrated Development Experience in VS 2010 and VS 2008 SP1 using just “Add Reference”

  • Data Source configuration has a new item to connect to SharePoint
  • Master Details type application development

Client Object Model

  • Supports
    • Site Operations
    • Lists, ListItems
    • content types, fields
    • but not administration namespace, farm objects
  • Implemented as WCF Service
    • …/vti_bin/client.svc
    • It passes batch command to the WCF service (in XML)
    • than the server executes and returns the data back to client (in JSON Other SharePoint Web Services
  • Advanced Operations
    • User Profiles
    • People
    • Search
    • Enterprise Metadata
    • Document Coauthoring
    • Excek REST web services
    • Publishing
    • Workflow
    • BCS web services
    • ….. see MSDN
  • we can also extend sharepoint and create custom web services
    • ASP.net
    • WCF (is now recommended for sharepoint 2010 custom service development)

WCF Services

  • Problem
    • IT Admin configures IIS
      • Different authentication schemes can be configured (Basic, Claims, Windows Integrated . . .)
      • Multiple IIS address bindings
    • Developer configures WCF Service endpoint
  • Solution
    • Dynamic (Programmatic) configuration
      this would be in RTM only
    • SOAP
      • Specify Service Factory in SVC file
      • Add MEX endpoint behavior attribute to the service class
      • Deploy SVC service to ISAPI Folder
    • REST

Demo of creating custom WCF service inside sharepoint

  • sandbox solutions doesn’t support services

WCF Service Configuration

  • Service.svc
  • SharePoint Service Factory creates the endpoint based on all authentications
    • service.svc/negotiate
    • service.svc/ntlm
  • SharePoint Http Modules

@PDC09 – Day 3 – Multitouch in Microsoft Surface and Windows 7 for .NET Developers


Multi touch

  • …creates new opportunities
    • software that is
  • is not new
    • researchers have been exploring this
  • is now going mainstream
    • hardware
    • OS
    • SDK’s

Microsoft surface and WPF4

  • with surface, microsoft became a thought leader in multi touch
  • surface has been shipping a multi touch dev platform for several years
  • Touch API’s baked into sdk

WPF 4 Touch Capabilities

  • (Beta 1)
    • Manipulation Events (pan, zoom & rotate gestures)
  • (Beta 2)
    • Touch Events
    • Extensible Touch Device
    • Win7 Touch Device
  • Release
    • ScrollViewer Panning Support
    • WPF controls styles with events

Demo of sample code

  • TouchDown, TouchMove and TouchUp events for canvas or any control
  • e.GetTouchPoint(_canvas)  - returns the coordinates for the touch point
  • _canvas.CaptureTouch(e.TouchDevice)
  • each UI element can capture multiple device events
  • _canvas.ReleaseTouchCapture(e.TouchDevice)

Multitouch in Web in Silverligh

  • Subset of the WPF4 touch input API
    • Reports groups of touch events in “frames”
    • Apps are responsible for hit testing and event routing
  • Manipulation & Intertia processor API

Demo WPF Multitouch Manipulation Events

  • ManipulationStarting event
  • IsManipulationEnabled = true for the elements like Image, to be manipulated for pan, zoom and rotate
  • ManipulationDelta event

Demo Manipulation Inertia (s

  • ManipulationInertiaStarting event (it is called at the end of manipulation, configure the inertia parameters here)
    e.g we can just scroll or throw the images using finger scroll,
  • e.TranslationBehavior.DesiredDeceleration = 0.001;

Inertia behaviors – 1/96th DIP (Device Independent Pixel) per milli sec

Touch Panning Support

  • Only in Release Candidate
  • Cancel() method on manipulation events
  • ScrollViewer handles manipulation events

Microsoft Surface Extensions of WPF

Surface WPF controls

  • Designed for multi touch
  • Designed for simultaneous user
  • Designed for manipulation & inertia

Drawing with Surface Controls

  • SurfaceInkCanvas control
  • ScatterView control
  • SurfaceScrollViewer control

Announcing – Surface Toolkit for Windows Touch

Surface is not just multi touch

  • Windows 7
  • Massive multi touch
  • Multi user experiences
    • Trend : software continues to reduce the need for face to face human interactions
    • Problem
    • Surface bring people together
  • Surface Objects
    • Byte Tags (256 unique values)
    • Identity Tags (move unique values)
  • Surface Optics
    • Determine the shape and size of every input
    • See into certain objects

Announcing – Surface SDK 1.0 is available for public download

Wednesday, November 18, 2009

@PDC09 – Day 2 – Networking and Web Services with Silverlight

                                                                   (Rough notes from the session)

Getting Data into Silverlight :

  • Message Pattern
    • Request / Reply
    • Duplex (email sending, confirmation received from server)
    • Multicast (Server send only 1 copy)
  • Interaction Model
    • Operation centric (service and client in memory passing messages)
    • Resource centric (start with data or data model, CRUD)

Data Access Examples :

  • “Forms over data” E2E business app  
    (Request / Reply Message Pattern solution / Travel Agent Application example)
    • WCF RIA Services (System.Web.DomainServices)
    • Perscriptive model for CRUD services
    • Great tooling to maximize productivity
    • E2E data: sorting, paging, filtering, validation
  • Access data from third party REST service  (System.Net )
    • ClientHttp networking stack (WebRequestCreator.ClientHttp)
      • Integrated with the OS networking stack
      • Support common BrowserHttp stack features for consistent experience
      • Basic, Digest and NTLM authentication is supported in client stack
    • BrowserHttp stack
  • Access your database or SharePoint data model using REST (System.Data.Services)
    • WCF Data Services
      • Formerly ADO.NET data services
      • Services with RESTful interface and a set of conventions designed for easy data sharing
    • What is Data Services?
      • Server framework for .NET, other coming
      • Clients for silverlight
    • Accessing Data Services
      • Silverlight ClientHttp stack still an option
      • Data services client more usable as it knows the details of the data service interface
      • Features
        • Full abstraction on top of the services – no need to serialize
        • Data as objects with automatic change tracking
        • LINQ to querie
      • WCF Programming Model
        • Programming Model
          • Core Services
          • Web HTTP Services
          • Data Services
          • RIA Services
          • Workflow Services
        • Service Model
        • Channel Model
  • App which accesses server business logic (Operation Centric – System.ServiceModel)
    • Generated proxies
    • Serialization of objects on wire
    • High performance
    • Binary Message Encoder (server throughput increase / message size reduction)
      • Its the default encoder
      • It can also be used with IIS Gzip compression
    • WCF Features
      • Faults enabled in SL3
      • To get full exceptions, use ClientHttp stack
      • Security in cross domain scenarios enabled
        • Normally use browser-managed security (generally not safe for cross-domain use)
        • Transport security with message credentials in cross-domain scenarios
          (Browser never sees the credentials and can’t cache it for malicious things)
  • Chat app (System.Net)
      • Duplex Messaging
        • Server push is compelling when server has to notify client of events (email server)
        • Internet: PollingDuplex (HTTP-based)
          • SL4 – performance enhancements and scale across machines (for azure)
        • Intranet: NetTcp (TCP sockets based)
          • Also works for request / reply services
        • Both of above use same programming models, just need to change the binding
  • Streamed data (video, stock prices) inside an intranet  (System.Net)
    • Multicast Messaging
      • Scales to a large receiver population
      • Two key shapes
        • Single source multicast
        • Any source multicast
      • Need to expose a policy responder (just like sockets and http)
        • SL4 – policy file is going away for both sockets and multicast if app is elevated

@PDC09 – Day 2 – Developing Advanced Applications with Windows Azure

                                                                   (Rough notes from the session)
By Steve Marx, Technical Strategist, Microsoft Corporation

LB –> Web Role + Worker Role

Official shipping version of the Table Storage SDK is available now

What we’ll Build – Search application using IIS + SMTP  + Web and Worker Roles
  • Three role architecture
    • Web UI (ASP.net MVC)
    • SMTP Server (TCPListener)
    • Search (Lucene.NET)
  • New Features we’ll take advantage of
    • Inter-role communication
    • Non-HTTP endpoints
    • Role instance lifecycle
    • VM sizes
    • Local storage
HOW TO: Model your application
  • Draw the boxes and arrows
  • Each box is a role
    • Which receive traffic from the internet
    • Which need IIS?
    • Which receive internal communication?
Receiving Traffic. Input Endpoints
  • Different ports on the same domain
  • Always load balanced
  • Declared in ServiceDefinition.csdef
  • Handled by IIS in web roles
  • Handled by your code in worker roles
  • API to find
The instance could should always be atleast 2 or else SLA isn’t valid.
Azure Storage Explorer in codeplex

Input Endpoints Demo :  Set the configurations in the xml file
As an Aside about Email
  • Spammers will use Windows Azure. (sending email should not be done via azure as the IP is not trusted)
Asynchronous work without a Queue
  • Queues deliver messages to one worker
  • We need every worker to see the messages
  • Use a table instead
    • build your own secondary index
    • order references
    • (Beware of clock drift!!)
HOW TI: DO Initialization
  • don’t want traffic until we are listening
  • role instance lifecycle lets us prepare
    • both web roles and worker roles
    • OnStart() - “busy” state, initialization
    • Run() – do work
    • OnStop() – traffic stops, graceful shutdown
HOW TO: Internal Endpoints
  • Declare endpoints in servicedefinition.csdef
  • API to find out what port to listen on:
    RoleEnvironment.CurrentRoleInstance.InstanceEndpoints[“”]
For internal endpoints always rely on the API to provide the port number, do not assign any port number.
HOW TO: Get more RAM
  • RAMDirectory puts everything in memory
  • If we have lots of data, we need lots of RAM
  • Choose among four VM sizes:
    • Small
    • Medium
    • Large
    • Extra Large
  • Simple edit to servicedefinition.csdef
    <WorkerRole  vmsize=”ExraLarge” />
HOW TO: Save the Index
  • Lucene.NET writes files to the local system
  • Preserve those across reboots/upgrades : 
    <LocalStorage cleanOnRoleRecycle=”false” />
  • Consider writing state on OnStop()
    (this is the to write I was on record XX and save the last state)
Using In-Place Upgrade
  • Rolling Upgrade
  • Specify which roles to upgrade
  • Keep local storage intact
  • Great for stateful roles

Call of Action:
  • Any instance can talk to any other
  • Don’t need IIS to listen for traffic
  • Use the role instance lifecycle
  • Choose different VM sizes
  • In-Place upgrades

@PDC09 – Day 2 - Keynote


These are some very rough notes from the today’s keynote at PDC 09’ . . . .  

Topic : Windows 7

  1. Developing windows 7
  2. developing for windows 7
  3. looking forward

Developing windows 7 : Learning

  • Solving problems + innovation
  • “Engineering 7” dialog
  • Ecosystem readiness
  • Developer pre-beta, beta, RC rhythm
  • Telemetry
    • Send feedback button
    • hardware and device diagnostics
    • reliability analysis component (RAC)
    • software quality monitor (SQM)
    • windows error reporting (WER or “Watson”)

Behind the scenes - “funny video”

  • push pin chairs
  • electric chairs

Telemetry figures (this one was interesting)

  • 514 million times the start menu was clicked (last 6 months)

Developing windows 7 : Research

  • Surveys, market studies
  • Reviews, blogs, commentary
  • Segment engagements
  • follow me home
  • Baseline studies
  • prototype testing, usability testing

Feature explanations and their videos on why they were added : \

  • UAC – Choose when to be notified
  • Windows Management – Tiling, Shake window

Ecosystem Energy – Michael Angiulo

All hardware demos discussing the hardware optimization and enhancements done

Making of a laptop : hardware / software

Announcement - FREE Acer Notebook Laptops with Windows 7 for all attendees !!!!

IE-9 already in progress
- ACID3 (32/100)   IE-8 had (20/100)
- multi system performance (picture)
IE-9 Demo

Windows 7 : Call of Action

  • Integrate with windows 7 desktop
  • develop for 64 bit
  • focus on fundamentals in your code
  • build on new API’s in windows 7

(today – channel9 videos on IE-9)

Scott Guthrie enters in and a huge applaud and woooh from the crowd !!!!

Silverlight 3

  • Sketch flow

Silverlight on 45% of internet PC’s

Announcement : Silverlight 4

Silverlight 4 Beta Download : http://silverlight.net/getstarted/silverlight-4-beta/
Silverlight 4 Training Course : http://channel9.msdn.com/learn/courses/Silverlight4/

Below are the new feature List :

  • Media
    • webcam and microphone
    • multicast streaming (IIS smooth streaming)
      • source of silverlight media player is on codeplex
      • publish media on variety of devices (apple iphone)
    • output protection
    • offline DRM
  • Business applications
    • Printing
    • Rich Text
    • Clipboard Access
    • Right Click
    • Mouse wheel
  • Application development
    • implicit styles
    • drag/drop word files into the rich text editor control
    • bidi & rtl
    • HTML control inside silverlight
    • commanding and MVVM
    • additional controls
    • print preview dialogs
  • Data and Networking
    • share assemblies across SL and .Net 4 with just 1 time compilation
    • Data binding improvements
    • UDP multicast support
    • REST enhancements
    • WCF improvements
    • WCF RIA services
  • VS 2010
    • full WYSIWYG design surface
    • XAML intellisense improvements
    • data binding, layouts, styles

Demo of Silverlight 4 (RIA and databinding) by Scott Hanselman
Snapflow.com demo

  • Beyond the browser (outside browser features)
    • windowing API’s
    • notification popups
    • HTML support
    • Drop Target
    • Running outside sandbox for outside browser application (Trusted applications)
      • Custom window chrome
      • local file system
      • cross-site network
      • keyboard in full screen mode
      • hardware device access
      • COM automation Support (e.g using dynamic keyword in .net 4.0 for office and geolocation API’s)
  • Silverlight 4 Performance
    • Twice as fast
    • 30% faster startup
    • new profiling support

Silverlight SDK for facebook published last week

Reference facebook application would be shipped soon (excellent application demo)

Schedule for Silverlight 4

  • Beta – Now Available
  • RC  -
  • Final  - Mid next year

Kurt Delbene – Office and SharePoint 2010

Microsoft Business Productivity Infrastructure

Announcement – SharePoint2010 Beta available now !!!

SharePoint 2010 Public Beta Download : http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx

Tuesday, November 10, 2009

SharePoint 2010 Developer Training (for FREE)


Another gem coming out of the Channel9 Learning Center Courses is the new ‘SharePoint 2010 Developer’ Course. The course material is presented by Ted Pattison and Andrew Connell themselves which makes it even more interesting.
Currently there are around 37 videos along with the presentation decks being posted on various improvements done in SharePoint 2010 around many areas like :

  • Visual Studio Tools for SharePoint 2010
  • UI Enhancements
  • Lists and Schemas
  • LINQ to SharePoint
  • Client Object Model
  • Workflow
  • Services Architecture
  • Accessing External Data
  • Enterprise Content Management
  • Extending Search
  • PerformancePoint Services
  • Sandboxed Solutions
  • SharePoint 2010 Security

The videos would soon follow by the Hands On Labs, Source Code and other materials for ITPro’s as well, so keep watching the updates on this course . . .

Monday, October 26, 2009

Visual Studio 2010 (Beta 2) – First Look


Here are some screenshots of VS 2010 Beta 2 (Ultimate) and some of the new features coming along with it :

I just liked the new curvy splash screen . . .

splash screen

That is the new ‘Startup’ Page. If you are new to Visual Studio or want to know ‘What’s New’, this page has ton’s of information to get you started and also lots of guidance and resources links for various platforms including Windows, Web, Cloud, Office, SharePoint and Data.

startup 1

image

Here is the Project Templates Screen. A bunch of templates are now included out-of-the-box in VS 2010 including Cloud, SharePoint, Silverlight and off-course the new Visual F# templates for Windows & Silverlight applications

image

Some of the new Explorer’s including the ‘Architecture Explorer’ and other windows – F# Interactive, Performance Explorer, Code Metrics Results 

image

Performance Analysis as well as the much interesting ‘IntelliTrace’ feature. Find out more about IntelliTrace here

image

Performance Analysis Report. . .

image

The ‘Generate Dependency Graph’ feature which generates a DGML document, part of the Architecture Tools in VS 2010

image


Also you can downloaded the Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview which has lots of Presentations & Demos on many of the new features and language enhancements coming up in .NET 4.0

image

image

Wednesday, October 21, 2009

SharePoint2010.Microsoft.com & SharePoint2010 Resources


Since last 2 months Me and my team went through an exciting journey of migrating the existing Sharepoint.Microsoft.com site (which we created a while back) to the upcoming version of SharePoint, i.e SharePoint 2010.

image

When we started the project, the product was hardly in its beta stages. So we had a bit of struggle initially to understand some of the advancements but overall with the excellent support from out college Todd and the MS team we not only understood the product well but also successfully launched the site just before the SharePoint Conference 2009.

There are various materials out now to know more about SharePoint 2010.

Andrew Connell has posted some great articles on his blog explaining some of the new advancements done in the product :

There are bunch of resources including the SharePoint 2010 (Beta) Developer center and other links on the Microsoft SharePoint Team Blog as well as,
Paul Andrew has posted some really good links of a white paper by David Chappell, SharePoint 2010 Developer Platform Post and many other resource links here

We are about to start the Phase II of the project and would be adding cool new features on the 2010 site showcasing some of the new advancements of the product, so stay tuned . . . . . 

Sunday, October 04, 2009

VS2010 & .NET 4.0 Sneaky Features


A must watch features Video from Mr. Guthrie himself on VS2010 & .Net 4.0 

  • Parameter Usage Highlighting
  • RegEx based Intellisense Filtering
  • View Call Hierarchy for Methods
  • Vertical Text Selection
  • Consume First Intellisense Mode
  • Snippets for Markups & JavaScript
  • Debug History
  • .Net 4 (New CLR)
  • Search Project Templates on Online Gallery
  • VS Web Development (Code Optimized) Profile
  • URL Routing in Web Forms
  • IIS SEO Toolkit
  • XML comments in Intellisense within JavaScript file
  • Dynamic named variable Intellisense in JavaScript
  • T4 Template customization in ADO.net Entity Framework
  • LINQDataSource + QueryExtender Control
  • DynamicValidation of data
  • New Markup Syntax for automatically HTML encoding . . <%: Message %>

Lots more in the Video so check it out. . . .

Monday, September 07, 2009

Diving & Exploration


Gems which I found last month :
  1. Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows
    If you are a MS developer you would know Mr. Hanselman and this popular post series wherein he lists out some of the most powerful tools for windows.
  2. 50 Windows 7 tips, tricks and secrets
    One stop shop of all the cool features of Windows 7.
  3. Cloaking your ASP.NET MVC Web Application on IIS 7
    Here Howard explains the security aspects of a publish facing web application and how we can change the header information of an ASP.net MVC application on a WISA (Windows, Internet Information Services, SQL Server, ASP.NET) Platform
  4. The role of a hands-on software architect
    This is an excellent article from ‘coding the architecture’ community explaining - “What should a hands-on software architect do?” in various aspects of project life cycle.
  5. 10 Things Every Software Architect Should Know
    This is an excerpt from the Richard Monson-Haefel’s 97 Things Every Software Architect Should Know,  where he collaborated with over two dozen authors to collect 97 axioms of software architecture

Friday, September 04, 2009

SOS debugging extension on 64bit Applications


Recently I got into a problem running the SOS on a 64bit Virtual Machine. Visual Studio gave the following message :

---------------------------
Microsoft Visual Studio
---------------------------
Error while trying to run project: Unable to start program '<app path>'.

The debugger does not support debugging managed and native code at the same time on this platform.
---------------------------
OK  
---------------------------

Binging’ around I found that there is a known issue in Visual Studio 2008 Mixed Mode Debugging for 64bit Applications. Since to run the SOS we have to ‘Enable unmanaged code debugging’, hence the issue.
The only way I could make it working with VS 2008 was by changing the Platform Configuration to x86.

Tuesday, September 01, 2009

Spec# - Code Contracts in .Net 4.0


Spec# is a formal language for API contracts (influenced by JML, AsmL, and Eiffel), which extends C# with constructs for non-null types, preconditions, postconditions, and object invariants.”

Code Contracts is a library which provides a language-agnostic way to express coding assumptions in .NET programs and would be included as part of the base class library in .NET 4.0. The contracts can be called as a subset of Spec# and take the form of preconditions, postconditions, and object invariants”

Let’s see how an we leverage code contracts. After installing the code contracts create a new VS Project (I used a console app here) and add the reference to ‘Microsoft.Contracts.dll’, which you would find in ProgramFiles\Microsoft\Contracts\PublicAssemblies\v3.5. Then enable the Static Contract checking in VS (which is the whole purpose of contracts, validating things at compile time rather than runtime). Goto –> Project Properties and you check the options as shown below :

image  

Now lets see some quick examples of precoditions, postconditions and object invariants . . .

Preconditions - What does it expect? As the name suggests, precoditions are contracts to ensure that the expected data is provided while performaing an operation.
e.g. :
image
Postconditions - What does it guarantee? Postconditions are contracts to ensure certain conditions are met just before exiting an operation.
e.g. :
image
Object Invariants - What does it maintain? Object invariants express the conditions under which the object is in a good state.
e.g. :
image
(In the above customer class we have an invariant contract to check that the ID should always be greater than zero, which is being called after each public method calls and validated)
Interface Contracts
Code contracts can also be applied to Interface methods by creating a sealed classes as shown below :

image
There are many other methods in the Contract class which could be used in many other scenarios. Checkout the documentation of this library and Matthew’s blog post for more details.

Sunday, August 16, 2009

Gartner's 2009 Hype Cycle


Last week ‘Gartner’ published its 2009 Hype Cycle report which is by far the Largest to Date With the Expansion of New Topics. Gartner, Inc. has examined the maturity of 1,650 technologies and trends in 79 technology, topic, and industry areas.



No doubt ‘Cloud Computing’ is at the peak of the hype since almost every major players in the industry are talking about it and building their long term strategy around providing cost effective and reliable services over cloud.

It is interesting to see that Surface Computers and 3-D Printing are climbing high while Microblogging and Green IT are slopping down the peak.

Here is the detailed analysis of the report and if you have seen this report first time read these details to better understand the report.

Wednesday, August 12, 2009

First Look at - Silverlight SDK for Bing


Recently I downloaded and tried the ‘Silverlight SDK for Bing’. The SDK includes a very cool application with it, which basically demonstrates some of the new controls from View Control Toolkit and some of the advanced data metaphors shown in the Bing search component. Here is how the application looks :

image
with search results . . .

image

The most interesting stuff that I found in the SDK is the View Control Toolkit, which includes many reusable  controls for Silverlight for overall enhancing the visual metaphors. Below are some screenshots of those views :

  • StackView : This is very similar to a Listbox but the cool thing in StackView is that it has a build in vertical blind-style animation for each item, which fires in sequence as the items are added.
    image
  • TileView : This control also has a cool seek-from-origin style animation for each item, which fire in sequence as the items are added.
    image 
  • CloudView : This view displays the results with dual axis, one being Relevance and other is configurable based on data type. CloudView also provides a simple magnification function so that items can be magnified when clustering occurs
    image 
  • BandCloudView : This view enhances the cloudview by providing a configurable vertical and horizontal axis and an extensible model using flexible data binding and sorting. The difference between CloudView and BandCloudView is that in CloudView, items are arranged free form across a fluid Cartesian surface. In BandCloudView, items are arranged in vertical bands based on granular division. Items in each band are arranged horizontally within each band as if each band were a horizontal list. It also has a cool item animation, which animates the items from the center of the view at data binding time.
    image

The crux of all the animations in all these views is the “MultiView” control which essentially is a stack of MultiView Panel controls which animates panels into views.

The SDK also includes a detailed help on all the components with examples in both C# and VB. So to get started first you would need to create a Bing AppID, then download the Source Code and change the AppID in the SearchEnvironment.cs file - line 105 and get silvery binged  :-). . . . .

Wednesday, July 29, 2009

Managing Azure Storage with ‘Cloud Storage Studio’


Recently I had an opportunity to explore the private beta of ‘Cloud Storage Studio’ by Cerebrata

Cloud Storage Studio is a WPF app which allows you to manage your tables, queues and blob containers for Windows Azure Storage. Although there are limited features right now in the app but I really liked the overall simplicity and ease of use. 

 image

Also there are various configuration settings available which can be applied on all Tables, Queues and Containers like Maximum Tables, Entities, Queues and Blobs per Request, Request Timeout.

The one that I liked the most is the Block Size Settings for Upload/Download Blob Size. This is very important when you are uploading a large chunk of blob data. The CSS would automatically divide a large Blob data in block based on this configuration so that its faster and easier for uploading.

image 

I would definitely recommend everybody to get its private beta from here,  try out yourself and provide your valuable feedback as they are really listening with big ears :-)

Also I had a chat with Gaurav Mantri (owner of Cerebrata) about the upcoming features and vision of CSS and believe me it was super exciting, so please stay tuned and keep your eyes on this . . .  

Thursday, July 23, 2009

“Gestalt” - Writing XAML code inside your HTML


Gestalt is a library released by MIX Online Labs that allows you to write Ruby, Python & XAML code in your (X)HTML pages. It enables you to build richer and more powerful web applications by marrying the benefits of expressive languages, modern compilers, AJAX & RIAs with the write » save » refresh development model of the web.”

My First Thoughts:
· It’s a great entry point for someone to learn and try out XAML (especially for web designers)
· It is not so intuitive for building complete business apps in something like silverlight

Any more thoughts are welcomed  !!!
Cheers . . .

Monday, July 13, 2009

SharePoint 2010 Sneak Peek . . . .


Last 2 weeks were full of excitement, thrill, lots of sleepless nights and several barrels of fluids . . . . all this for :

image

The SharePoint 2010 Sneak Peek site is launched today. The site previews some of the upcoming features in SharePoint 2010. Again a good project completed with an excellent team . . .

Cheers . . . . .

Saturday, June 20, 2009

Opera Unite - Reinventing Web?


Opera Unite : “A new technology that shakes up the old client-server computing model of the Web”.

Opera unite provides the following services:


Here is good post on installing and configuring these services. The only service that I felt interesting was the ‘Web Server’. So I tried it and the first cut really went well. Below is the link of a file hosted on my laptop by unite:
http://home.jomitvaghela.operaunite.com/webserver/content/

My first impression:
While the services being offered are not at all new, the crux here is the ease of sharing this from your own device using a simple browser.


Try it out yourself and share your thoughts. . . . .

Friday, June 19, 2009

Rebuilding Microsoft.com/SharePoint


Since last couple of months I, along with my wonderful team including
Todd, Vivek, Meeta and Ritu had been working with Tony on rebuilding the Microsoft's SharePoint web site.

The web site went live last month :
http://www.microsoft.com/sharepoint . . . .


and now, there is also a 'How we did it' article on MSDN describing goals and technicals details of how we developed all the pieces and fitted it together.

Tuesday, June 02, 2009

Loading .xap files OnDemand using Composite Client Application Guidance (PRISM)


One of the challenges of porting large business applications on silverlight is the size of .xap file. A typical business app would have multiple screens, rich data visualization and lots of user interaction which would in turn increase the overall size of the xap file. Also it would have users with multiple roles and each role would have specific permissions to specific screens. 
So wouldn’t it be nice to divide the entire app into multiple silverlight modules and than load them only when required  ? This is where PRISM can help us . . .

Composite Client Application Guidance (PRISM) provides us a rich framework to divide a silverlight application into various Modules and also load them ‘on demand’. A module can be a separate silverlight app. You can watch Erick’s video for creating the basic structure of a PRISM Project.

The solution structure for our scenario would be a bit different with multiple Silverlight Applications linked to a Single Web App as below :

image

image

Now what we need is a Default View which would be loaded first and than some triggers/events which would load the other on-demand views. 
In our case “DefaultView” is in “MyPortal” app and the “VoterModule” inside MyVoterModule Application would be loaded on-demand when a button is clicked from “DefaultView”.

Next, we need to add our Modules into the ModulesCatalog :

image

ModulesCatalog.xaml

 image

The important thing to note here is that we can create groups of modules and than can specify when do we want to initialize the modules being loaded in that particular group. We can also add modules via code instead of loading it from a xaml file.

Than we need to create some event on the DefaultView which would load the VoterModule. I have created a simple button as under, but we can also add more complex business logic to drive the loading of modules :

image

That’s all we need. The VoterModule would add the appropriate view onto the region and since we have specified to load this “OnDemand” the entire .xap for that application would be loaded when we click on the button.

We can also verify this using Fiddler . . .

Sunday, May 10, 2009

Diving & Exploration


Internet is like a deep ocean with many hidden gems so I just thought to wear my scuba suit and find those gems and share them. This is what I found last month :

Sunday, March 15, 2009

Re-Sizing .VHD Files


While creating a Virtual Disk (.VHD) for Virtual PC we need to allocate a maximum size for both Dynamic and Fixed sized disks. Now once we set this size it’s really difficult to change it. I had a similar issue last week and luckily I happen to find a solution for it which I am going to share here.

Firstly we would need the Vhd Resizer tool from the vmToolkit. This tool would copy sector by sector all the contents of a VHD and create a new VHD with the new size.

vhdresizer

Once the resize is complete the added GB’s/MB’s would be shown as an unallocated partition in the new VHD file. (To view the partitions, start the VPC (with the new VHD) -> Right Click My Computer > Click Manage -> Disk Management)
Now to merge this unallocated partition we need to use a command line utility ‘diskpart’ as follows:

Open command prompt and type diskpart, press enter and you would get this prompt

diskpart

· Type list disk (this would list all the disks)

· Type select disk # (select the disk number in which you want to merge the unallocated partition)

· Type detail disk (this would display all the volumes of the disk)

· Type select volume # (select the volume number in which you want to merge the unallocated partition)

· Finally Type extend (this would merge the unallocated partition on the selected disk & volume)

Open the Disk Management again and you should see the new size of the VHD. We can also use other tools like Partition Magic for merging the unallocated partitions.

Friday, March 06, 2009

How to create context menus and capture right click event in Silverlight


Context menus & right click event is something which is not out of the box supported in silverlight but I think they prove to be very crucial while developing LOB applications. So here is a workaround on how you can create them. Basically I am using HTML/Javascript to create and render menus on top of silverlight but it involves a few tweaks which are listed below.

First tweak is – How to display a HTML Menu on top of silverlight control.
For this we need to change 2 properties on the .aspx or .html page where the silverlight control is being hosted.

      <param name="background" value="transparent" />
  
<param name="windowless" value="true" />


Than capturing the right click event in HTML and displaying our menu.

<
script language="javascript">

  function click(e) {
     if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 2) {

                var menu = document.getElementById('myMenu');
                menu.style.left = event.clientX + 'px';
                menu.style.top = event.clientY + 'px';
                menu.style.visibility = 'visible';
                return false;
            }
            return true;
  }
  document.onmousedown = click

</script>

'myMenu'
is a <div> I have created on the html page which contains a simple table as below:

<
div id="myMenu" style="position: absolute; visibility: hidden; width: 75px">

   <table width="100%" style="background: #000000" cellspacing="1" cellpadding="1">
    
<tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand">
             
Edit
        
</td>
    
</tr>
     <tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand"> 
              Save

        
</td>
    
</tr>
     <tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand"> 
              ________

        
</td>
    
</tr>


     <tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand"> 
              Exit

        
</td>
    
</tr>

   </table>


</
div>

The SomeFunctionWhichCallsSilverlight() function would be the interop function to call the relevant Silverlight function as described in my earlier blog.

Now the last thing is to disable the default ‘SilverlightConfiguration’ menu

<body oncontextmenu="return false">


You can download the sample code from here

AddIn