Thursday, June 26, 2008

SQL Server 2008 RC0 - Now Available

SQL Server 2008 was recently announced for download here. This download is a trial version and will expire in 180 days.

As I mentioned some time ago in this post that in order to use server explorer in VS 2008 with SQL Server 2008, you'll need to download VS 2008 SP1 beta. So you'll need this SP if you want to use the entity framework in VS 2008 with LINQ to SQL.

Refer to my original post if you want to get VS 2008 SP1.

I am currently downloading this RC as I write this.


Download manager

Tuesday, June 24, 2008

Controling your sorts under LINQ to SQL

I wrote an article recently about sorting generic arrays and changing direction easily in custom comparer classes here. As this is a device centric blog, using generic comparer classes is still the only (best) way to sort your collections in .NET after they have been read from SQL Server.

I said at the end of the above post that I'd write a quick post on how to do this using LINQ to SQL - bearing in mind this is *not* supported on the .NET CF 3.5. It is very simple and in fact alot easier with LINQ than in the above post. Usually new technologies come with an attached deep learning curve but with LINQ to SQL the learning curve is not that great.

In my last post we had a very simple customer object with a couple of columns. I've modeled this using the Entity Framework in VS 2008:


Entity Framework modeled table in Visual Studio 2008.

As you can see we have the same properties available to us as we did in the comparer post that we created manually. It is a very simple table with no relations.

Note, in order to create a LINQ to SQL mapping, you can right click your project in VS and choose "Add new item" from the context menu, then select LINQ to SQL Classes template.


Creating a LINQ to SQL mapping

I'm not going to go into too much detail on mappings and the various ways it can be done as the aim of this post is to show the syntax of sorting customer as opposed to that of using a comparer class.

If you've done any LINQ to SQL you'll know about the DataContext class. So now we have created our model VS has kindly created the object model for us so we can go right ahead and use it:
static class Program
{

[STAThread]

static void Main()

{

TestDevDataContext testDev = new TestDevDataContext();
var query2 = from c in testDev.Customers
select c;
Console.WriteLine("Before sort");
DisplayCollection(query2.ToList());

var query3 = from c in query2
orderby c.City ascending
select c;

Console.WriteLine("After sort - Ascending");
DisplayCollection(query3.ToList());
var query4 = from c in query2
orderby c.City descending
select c;
Console.WriteLine("After sort - Descending");
DisplayCollection(query4.ToList());
}

public static void DisplayCollection(List<Customer> customers)
{
foreach (Customer customer in customers)
{
Console.WriteLine(string.Format("Name: {0}, City: {1}",
customer.Name, customer.City));
}
Console.WriteLine();
}
}
The code is greatly simplified in this version over our generic array and comparer and with this example we need not write multiple comparers for each column we wish to sort on. Our custom DataContext class is named TestDevContext which is my test database on this machine (Vista x64).


Output of above

For interest, the SQL generated looks like the following:
SELECT [t0].[CustomerId], [t0].[Name], [t0].[AddressLine1], [t0].[AddressLine2], [t0].[AddressLine3], [t0].[City], [t0].[County], [t0].[PostalCode], [t0].[Country]
FROM [dbo].[Customer] AS [t0]
SELECT [t0].[CustomerId], [t0].[Name], [t0].[AddressLine1], [t0].[AddressLine2], [t0].[AddressLine3], [t0].[City], [t0].[County], [t0].[PostalCode], [t0].[Country]
FROM [dbo].[Customer] AS [t0]
ORDER BY [t0].[City]
SELECT [t0].[CustomerId], [t0].[Name], [t0].[AddressLine1], [t0].[AddressLine2], [t0].[AddressLine3], [t0].[City], [t0].[County], [t0].[PostalCode], [t0].[Country]
FROM [dbo].[Customer] AS [t0]
ORDER BY [t0].[City] DESC
As you can see each sort goes back to the database to get a new set of data, so SQL Server is used in this case to actually do the sort.

Controlling your sorts under List<T> - the old fashioned sort

NOTE: This article uses C# 3.0 syntax (VS 2008) if you would like to learn more about it's syntax please see here.

Why would I post something about List<>.Sort() I hear you ask, because isn't everyone using LINQ yet? Well for those who have legacy code in Comparer classes who do not wish to use LINQ, and besides everyone is blogging about LINQ right? :) Also as this post is device centric, both LINQ to SQL and LINQ to Entities are not supported on CF 3.5 so we have few options.

Which brings me to sorting a generic arraylist class. You can use Array.Sort(T) which uses the quicksort algorithm.

Usually you have to write a comparer class for each sort type. For example, if you wanted to sort a collection of customers by country, you would normally have a comparer class named something like CustomersCountryComparer. Or if you wanted to sort by city for example; you'd have a comparer named something like CustomersCityComparer. In the *old days*, I emphasize old days as they are not really old days but pre .NET 2.0 and generics the way we would write a comparer was slightly different to how we write them today. We historically would derive from CollectionBase and implement a sort method which would provide the sort operations with a sort direction ASC or DESC, easy.

But now we're all using generics, right! or should be at least for many reasons. Generic collections offer many benefits one of which is we no longer have to write an implementation of CollectionBase to hold our objects. Instead today we use List<> (generic ArrayList). Which exposes a sort method.

Here is the list of sort overloads as of .NET 3.5:

Name Description
Sort()()() Sorts the elements in the entire List<(Of <(T>)>) using the default comparer.
Sort(Comparison<(Of <(T>)>)) Sorts the elements in the entire List<(Of <(T>)>) using the specified System..::.Comparison<(Of <(T>)>).
Sort(IComparer<(Of <(T>)>)) Sorts the elements in the entire List<(Of <(T>)>) using the specified comparer.
Sort(Int32, Int32, IComparer<(Of <(T>)>)) Sorts the elements in a range of elements in List<(Of <(T>)>) using the specified comparer.

This is all fine and dandy, but often requirements state that they want to sort ascending or descending. How do you do this with the overloads defined above? You can't, the information has to be passed to the comparer, so when the List invokes Sort, comparer tells it which direction to sort to.

This post will show an example on how to achieve this.

The following code example shows a typical object which might be returned in a generic collection:
public class CustomerInfo
{
public int CustomerId
{
get;
set;
}

public string Name
{
get;
set;
}

public string AddressLine1
{
get;
set;
}

public string AddressLine2
{
get;
set;
}

public string AddressLine3
{
get;
set;
}

public string City
{
get;
set;
}

public string County
{
get;
set;
}

public string PostalCode
{
get;
set;
}

public string Country
{
get;
set;
}
}
Note the above is C# 3.0 syntax. Nothing too complex here. Suppose we now have a collection of Customers defined in a List:
List<CustomerInfo> customers;
This list could have been returned from a data layer in Country order ascending. But what if the user now wants to see the list of customers in City order descending. Do you go back to the SQL Server and get a new collection of objects based on the new query or do you manipulate the current set of data and display this to your user? The fastest way would always be to manipulate the data you already have rather than go back to the database. So this is where the Comparer class comes into the equation.

Before using our own comparer that we will pass to the Sort method of the List<> class, what happens if we call the default Sort method without passing over a IComparable instance?

We get an error whats what, we get a "Failed to compare two elements in the array." InvalidOperationException:

The code I used is as follows:

List<CustomerInfo> customers = new List<CustomerInfo>
{
new CustomerInfo
{CustomerId = 1, Name = "Joe", City = "London"},
new CustomerInfo
{CustomerId = 2, Name = "Pete", City = "Paris"},
new CustomerInfo
{CustomerId = 3, Name = "John", City = "New York"},
new CustomerInfo
{CustomerId = 4, Name = "Pete", City = "London"},
new CustomerInfo
{CustomerId = 5, Name = "Paul", City = "Dublin"},
new CustomerInfo
{CustomerId = 6, Name = "Steve", City = "Exeter"},
new CustomerInfo
{CustomerId = 7, Name = "Clare", City = "Norwich"}
};

customers.Sort();
Why didn't it work? It didn't work because CustomerInfo does not implement the IComparable interface. Instead we use a cleaner solution to implementing a IComparable for the colums of interest.

So what we'll do next is write a simple comparer class which we will feed into the arraylist class sort method. The interface that we'll need to implement is the IComparer.

The class looks like the following:public class CustomerCityComparer : IComparer
public class CustomerCityComparer : IComparer
{
private SortBy sortBy;



public CustomerCityComparer(SortBy sortBy)
{
sortBy = sortBy;
}


///
/// Returns one of the following:-
///
/// 1. Less than zero (x is less than y).
/// 2. Zero (x is equal to y).
/// 3. Greater than zero (x is greater than y).
///

public int Compare(CustomerInfo customer1, CustomerInfo customer2)
{
if (sortBy == SortBy.Ascending)
{
return customer1.City.CompareTo(customer2.City);
}
else
{
return customer2.City.CompareTo(customer1.City);
}
}


public SortBy SortBy
{
get
{
return sortBy;
}
set
{
sortBy = value;
}
}
}
Fairly trivial code. We use the CompareTo method because we are comparing string objects and not integers. Notice we have defined a constructor with a passing enum value type named SortBy. This forces the consumer to pass a sort type rather than defaulting to one.

Also note we have created a read/write property named SortBy which allows the consumer to change the sort direction of the comparer without creating a new instance of the object.

I've written a simple bit of code that creates a collection of customers and sorts acending and decending based on the City the customer is based.

This code looks like the following:
internal class Program
{
private static void Main(string[] args)
{
List customers = new List
{
new CustomerInfo
{CustomerId = 1, Name = "Joe", City = "London"},
new CustomerInfo
{CustomerId = 2, Name = "Pete", City = "Paris"},
new CustomerInfo
{CustomerId = 3, Name = "John", City = "New York"},
new CustomerInfo
{CustomerId = 4, Name = "Pete", City = "London"},
new CustomerInfo
{CustomerId = 5, Name = "Paul", City = "Dublin"},
new CustomerInfo
{CustomerId = 6, Name = "Steve", City = "Exeter"},
new CustomerInfo
{CustomerId = 7, Name = "Clare", City = "Norwich"}
};


Console.WriteLine("Before sort");
DisplayCollection(customers);

Console.WriteLine();

CustomerCityComparer cityComparer = new
CustomerCityComparer(SortBy.Ascending);
customers.Sort(cityComparer);

Console.WriteLine("After sort - Ascending");
DisplayCollection(customers);

Console.WriteLine();
cityComparer.SortBy = SortBy.Descending;
customers.Sort(cityComparer);
Console.WriteLine("After sort - Descending");
DisplayCollection(customers);

Console.ReadLine();
}

public static void DisplayCollection(List customers)
{
foreach (CustomerInfo customer in customers)
{
Console.WriteLine(string.Format("Name: {0}, City: {1}",
customer.Name, customer.City));
}

}
The output from the code above looks like the following:
Before sort
Name: Joe, City: London
Name: Pete, City: Paris
Name: John, City: New York
Name: Pete, City: London
Name: Paul, City: Dublin
Name: Steve, City: Exeter
Name: Clare, City: Norwich
After sort - Ascending
Name: Paul, City: Dublin
Name: Steve, City: Exeter
Name: Pete, City: London
Name: Joe, City: London
Name: John, City: New York
Name: Clare, City: Norwich
Name: Pete, City: Paris
After sort - Descending
Name: Pete, City: Paris
Name: Clare, City: Norwich
Name: John, City: New York
Name: Joe, City: London
Name: Pete, City: London
Name: Steve, City: Exeter
Name: Paul, City: Dublin
If we wanted to sort on different fields then we would create another custom comparer.

Of course LINQ to Entities makes this much easier. I will write a simple example on implementing this using LINQ in my next article. - Please note though, LINQ to entities are not supported on devices.

Tuesday, June 17, 2008

Tech-Ed Developers EMEA 2008



Tech-Ed Developers EMEA 2008 has recently been opened for registration.

Super early bird is available until 31st July. It's still early days so the sessions haven't been announced yet.

Sunday, June 15, 2008

WM 5.0/6.0/6.1 SKU Matrix

Microsoft recently published an SKU matrix for WM 5.0/6.0/6.1 devices:
http://www.microsoft.com/windowsmobile/6-1/version-comparison.aspx

Using 'LIKE' in LINQ to SQL under C#

I've been investigating LINQ to SQL over recent months and I opted to do a VS 2008 course which covers many .NET 3.5 features and language enhancements etc etc

One of the questions on this course was to change some code to return items that contained the word "Blend". So a wild card statement in other words. Now in SQL this is easy. Under LINQ to SQL I originally coded:
 var query = from c in db.Coffees
where c.CoffeeName == "%Blend%"
select c;
But this didn't work. This wasn't too surprising as LINQ is not about a specific type of data access, it's about building a generic querying interface that is common across many persistent storage mediums and not just SQL Server.

I found this post where I realised that LINQ uses the standard string methods such as Contains, StartsWith etc for these purposes. So I changed my LINQ query to use the Contains method and it worked!
  var query = from c in db.Coffees
where c.CoffeeName.Contains("Blend")
select c;
After executing this query we get the following from the SQL trace:
N'SELECT [t0].[CoffeeID], [t0].[RegionID], [t0].[SupplierID], [t0].[CoffeeName], [t0].[SizeDescription], [t0].[Description], [t0].[UnitPrice], [t0].[UnitsInStock],
[t0].[ReorderLevel]
FROM [dbo].[Coffee] AS [t0]
WHERE [t0].[CoffeeName] LIKE @p0',N'@p0 nvarchar(7)',@p0=N'%Blend%'

As you can see the Contains was translated into LIKE and % to give us the match, very neat.

Friday, June 13, 2008

ReSharper 4.0



When I was in Seattle last, I was writing some code on my laptop in C# and fellow MVP Jan Yeh happen to notice my language of choice was C#. He asked me if I had every heard of ReSharper, I told him I had heard of it but hadn't used it. Jan highly recommended it, when I arrived back in the UK, I shortly received an email from Jan with details of the developers over at JetBrains to contact in order to get a license for ReSharper.

After contacting Britt at JetBrains I shortly received a response which included a MVP license so I downloaded the tool. Since doing this I've never looked back and I don't know how I ever lived without it, it is a must have tool for any developer.

The version I downloaded was 3.1. Version 3.1 had separate installs for VS 2005 and VS 2008. Also, under VS 2008 there was no support for C# 3.0 or LINQ. In the latest release which was released on 9th June (ver 4.0) there is one single install for both VS 2008 and VS 2005 which makes the whole install experience cleaner. In addition there is now support for C# 3.0 and LINQ.

You can get a 30-day trial of ReSharper here. I mentioned C# above, but in fact the tool works with VB as well, although I haven't tried it with VB.

So what does ReSharper do? In a nutshell ReSharper enhances the development experience for a .NET developer. There are so many features I recommend you try it to find out. But to wet your appetite, I will show a few cool features that I particularly like.



The above example shows a program that has declared a bunch of using declarations but two are not required and they are identified as redundant due to the gray fore colour, neat.

Placing your mouse cursor over the redundant using statement shows a tool tip:



Also placing your mouse cursor over the gray text, reveals an icon as per below. When you click this icon it will reveal a menu which in this case gives you a list of options, one of which allows you to remove the unused using statements. Sweet. In fact this icon is used extensively throughout the IDE with regards to add on features.




There is another nice feature that I'd like to talk about which is related to documentation in your code. Notice in the screenshot below both param elements are incorrect. They are identified as incorrect as the forecolour is set to red. This feature is really powerful as if you use a tool such as nDoc to generate your documentation for your libraries then the documentation will be wrong. This also works with complex types. If x was a complex custom type which didn't exist, you'd get the same red marking. This makes it even more powerful as the documentation will not be able to link to the required types that do not exist which often results in an error message being displayed - doesn't look good when your clients are trying to use your libraries.

Do note with this though, there is no warning output in VS (not sure if there is a configuration to do this).



Intellisense is greatly improved under ReSharper which is seem less in Visual Studio. For example. If I have a couple overloads of the method named Foo as follows:



I might be feeling lazy and instead of looking at the documentation for method Foo, I might want to see what overloads and parameters etc that are available to me through intellisense - this is quite common for developers.

As you know in Visual Studio, if you are feeling lazy, usually you would sequentially iterate through the overload list to view them all. ReSharper addresses this problem by giving you an exploded view of the method overloads with all parameters:



This is quite neat. As you can see, we can clearly see all overloads for method Foo. What we can't see is comments for all overloads at once. We have to highlight the overload we're interested in in order to see the comments. I'm guessing here, but probably JetBrains thought about this and if they were to output comments (documentation) for every overload at the same time you might quickly run out of screen space for very large classes with multiple overloads. We only have three in the above example, but some methods have many more than this with many parameters in some cases. I really like this feature.

Another cool feature related to intellisense is filtering of member types. So If an am querying an object with many members, properties, methods, events etc as I type, ReSharper filters out the list of items:


In the above screenshot, we can see the list of all members because we haven't yet typed anything.

In the screenshot below you can see we have typed the letter 'a', so here ReSharper filters all members that begin with the letter 'a'. Likewise if you were to type the next letter, it will filter by the first two characters and so on:




Another cool feature to mention. If you look at the screenshot of the intellisense which displayed a whole list of all members (like VS.NET has always done). Notice in the ReSharper version, some members are displayed in bold while others are not. The members displayed in bold are members that belong to the type in question as opposed to the members that are in regular style font are members that are derived from the type we are querying.

With the new release of ReSharper 4.0, C# 3.0 is supported:



Above we are using the new C# 3.0 feature which is known as collection initializers. If you would like to learn more about C# 3.0, see the latest C# specification here. I've written a couple of blogs on the new cool features available in C# 3.0 here.

As ReSharper is a Visual Studio plug-in, when installed a new menuitem appears under the mainmenu in VS:



There are many features in here many of which relate to the running of ReSharper, I'm not going to go into all of these but one in particular I thought I'd mention - which is in fact not on the main menu but defined in the context menu when right clicking a class in VS. This option is 'Cleanup Code...".



Clicking this option will load the Code Cleanup dialog:



As you can see from the dialog this process is profile based (new feature in 4.0). Clicking 'Run' will cleanup your code based on the profile rules. Clicking 'Edit Profiles' allow you to change the formatting to your custom requirements. This process does a whole bunch of stuff which enables you to adhere to coding standard easily. You can see how this is very powerful when you have a shop full of developers and you want the coding standard to stay intact. ReSharper is your answer to this. There are of course other tools such as fxCop which does a similar job although it doesn't clean your code up rather tells you want you are doing wrong!

There are so many more features in ReSharper in which I haven't talked about, I advise you to download and try today....

Wednesday, June 04, 2008

Silverlight 2 beta 2 will be released later this week

Today at 9am EST at TechEd, Soma Somasegar and Bill Gates announced that Silverlight 2 Beta 2 will be publicly available later this week. These new features are as follows:

· UI Framework: Beta 2 includes improvements in animation support, error handling and reporting, automation and accessibility support, keyboard input support, and general performance. This release also provides more compatibility between Silverlight and WPF.

· Rich Controls: Beta 2 includes a new templating model called Visual State Manager that allows for easier templating for controls. Other features include the introduction of TabControl, text wrapping and scrollbars for TextBox, and for DataGrid additions include Autosize, Reorder, Sort, performance increases and more. Controls are now in the runtime instead of packaged with the application.

· Networking Support: Beta 2 includes improved Cross Domain support and security enhancements, upload support for WebClient, and duplex communications (“push” from server to Silverlight client).

· Rich Base Class Library: Beta 2 includes improved threading abilities, LINQ-to-JSON, ADO.NET Data Services support, better support for SOAP, and various other improvements to make networking and data handling easier.

· Deep Zoom: Beta 2 introduces a new XML-based file format for Deep Zoom image tiles, as well as a new MultiScaleTileSource that enables existing tile databases to utilize Deep Zoom. Better notification for sub-images enter the view is another improvement in Silverlight 2 Beta 2.

The full release FAQ follows:

UX Key Messages:

· RIA: Based on proven .NET technology, Silverlight provides unparalleled productivity by enabling the reuse of skills, codes and assets.

· Silverlight 2 includes over 40 new controls, cross-domain networking support for calling REST, WS*/SOAP, POX, RSS, and standard HTTP services and a rich .NET base class library of functionality (collections, IO, generics, threading, globalization, XML, local storage, etc).

· Silverlight 2 also introduces Deep Zoom, which offer unparalleled interactivity with high resolution content.

· Expression Studio and Visual Studio provide role-specific productivity tools that empower designers and developers to easily collaborate on Silverlight projects. Today Microsoft released Expression Blend 2.5 2008 June Preview and Silverlight Tools Beta 2 for Visual Studio 2008

· Media/Advertising: Silverlight offers true HD video and the lowest TCO solution for media delivery and consumption. Microsoft is enabling new business opportunities by making it easier to build ads that plug into Silverlight and work with myriad network and syndication providers in the ecosystem. With support for Atlas and DoubleClick we are just at the tipping point of the amazing business opportunities possible with Silverlight.

· Mobile: Silverlight dramatically simplifies the design, development and delivery of rich interactive applications and services on the Web, desktop, and devices. Silverlight offers multiple benefits to the mobile industry including compelling cross-platform mobile experiences, multi-channel revenue opportunities, and industry leading application platform and tools.

· Since the launch of Silverlight last year, the interest and adoption of Silverlight continues to rise:

o In addition to existing customers around the world such as Entertainment Tonight, NBA, MSN, Hard Rock, Home Shopping Network, BMW, BBC, Yahoo! Japan, and Baidu, Microsoft is looking forward to a strong line up of new content that will be based on Silverlight 2. Notable examples include the upcoming Beijing Olympic Games and the Democratic National Convention.

o Beijing Olympic Games will deliver to millions of online users exclusive access to an unprecedented offering of over 3000 hours of live and on-demand video content. The combination of MSN’s audience reach and Microsoft’s Silverlight technology will allow NBC to deliver Olympics content to a broad U.S internet audience - all through an immersive and interactive video experience that will redefine how sports fans consume content online.

o Democratic National Convention will leverage Silverlight 2 to deliver all four days of live convention coverage via live footage, data feeds, archived content, and speaker information overlays.

o Over the last few months, the Silverlight Partner Initiative has grown significantly, comprising more than 85 members from content delivery networks, design agencies, ISVs and solution providers. This will further fuel the adoption of Silverlight, and provide monetization opportunities for partners.

  • Silverlight and Expression Studio are core technologies for enabling better user experiences on the desktop, Web and beyond. Microsoft’s user experience approach is part of the broader Microsoft Application Platform strategy, formed with the goal of helping customers realize the benefits of more dynamic applications.


SILVERLIGHT 2 BETA 2

When are the Silverlight 2 Beta 2 bits going to be available?
Download will be available later this week.

What is new in Silverlight 2 Beta 2?

As is typical with a beta, we’ve made a number of incremental improvements based on customer feedback. This includes:

· New and improved controls

· Networking and data handling improvements

· Improvements in error handling, reporting and development experience

· Updates to Deep Zoom and animation

· Updates to ensure WPF compatibility

· General improvements in performance

A full list of improvements and updates will be included in the release notes with the Silverlight 2 Beta 2 download.

What are the features of Silverlight 2?

Silverlight 2 builds on the foundation of Silverlight 1 but significantly extends the original development framework at every point. The most important innovation that Microsoft brought to bear with Silverlight 2 is its support for managed code. Because Silverlight 2 incorporates the core CLR classes, the runtime provides much richer networking stack support, including REST, RSS, JSON and POX and full support for LINQ including LINQ to SQL and LINQ to XML. In addition to supporting C#, VB.NET and other managed code languages, Silverlight 2 includes support for Dynamic languages including Ruby and Python as well as a 2 way HTML/AJAX bridge for full integration of Silverlight with AJAX-enabled applications.

With regard to user interface controls, Silverlight 2 adds over two dozen controls (such as button, check box, date controls, gridview, layout) that are designed to be used either right out of the box, or after being tweaked with styles. With Silverlight 2, the user interface controls are completely customizable, as the appearance of any control can be fully determined by templates and control behavior can be modified by hooking events or by creating custom controls. Similar to the layout controls in WPF, the new Silverlight 2 layout controls significantly enhances the ability to optimize the overall design of the UI. Finally, Silverlight 2 controls can now provide one way or two way databinding to any number of data sources including LINQ, in a highly scalable architecture that abstracts out the binding object.

Finally, Silverlight 2 provides secure client-side persistence through Isolated Storage. This dramatically reduces bandwidth requirements for any given RIA, as data can be cached locally on the client.

Should developers/organizations wait until Silverlight 2 RTW to build applications?

No. Silverlight 2 Beta 2 is a very stable and high quality build that comes with a commercial go-live license. Microsoft encourages developers to deploy their mission-critical applications on this release. For example, NBC will deploy a large, mission-critical rich media site, NBCOlympics.com, using Silverlight 2 Beta 2.

Will my applications built on Silverlight 2 beta 1 be compatible with Silverlight 2 Beta 2?

Silverlight 2 Beta 2 introduces some changes that will break certain applications targeting the previous version of the beta, Silverlight 2 beta 1 (which is one of the main reasons that Microsoft recommended not using Silverlight 2 beta 1 for commercial deployment purposes). For a run down on the changes and work-arounds please visit: www.silverlight.net.

Will my applications built using Silverlight 2 Beta 2 be compatible with the RTW release?

The next release introduces changes that will require developers to update their code. These changes are required to add more features, increase performance and stability.

Will my applications built using Silverlight 1 be compatible with Silverlight 2 Beta 2?

Yes.

Is Silverlight 2 Beta 2 compatible with Visual Studio 2008 and the .NET Framework 3.5 SP1 betas?

Yes.

When will Silverlight 2 RTW?

We are on track for RTW in the Fall of 2008.

What are the key features of Silverlight 3?

We haven’t made any announcements regarding Silverlight 3. Right now we are concentrating on getting Silverlight 2 out the door.

When can we expect a beta of Moonlight? Wasn’t it supposed to be released 6 months after Silverlight 1 RTW?

The first code for Moonlight was released on May 13, and you can find more detail on Miguel de Icaza’s blog. http://tirania.org/blog/archive/2008/May-13-1.html

When will Microsoft release Silverlight for devices?

At MIX08 Microsoft announced its intentions to deliver Silverlight on mobile devices with a focus on Windows Mobile and Nokia based (S60, S40, N8xx Internet Tablet) devices as a first priority. To date, Microsoft has created an invitation only private alpha program for Silverlight on Windows Mobile devices. Stay tuned to PDC in October 2008 for the next round of details and a broader public release.

What is the number of Silverlight downloads to date? What is the latest the company is saying on adoption?

· In addition to existing customers around the world such as Entertainment Tonight, NBA, MSN, Hard Rock, Home Shopping Network, BMW, BBC, Yahoo! Japan, and Baidu, Microsoft is looking forward to a strong line up of new content that will be based on Silverlight 2. Notable examples include the upcoming Beijing Olympic Games and the Democratic National Convention.

· Beijing Olympic Games will deliver to online users exclusive access to an unprecedented offering of over 3000 hours of live and on-demand video content. The combination of MSN’s audience reach and Microsoft’s Silverlight technology will allow NBC to deliver Olympics content to a broad U.S internet audience - all through an immersive and interactive video experience that will redefine how sports fans consume content online.

· Democratic National Convention will leverage Silverlight 2 to deliver all four days of live convention coverage via live footage, data feeds, archived content, and speaker information overlays.

· Over the last few months, the Silverlight Partner Initiative has grown significantly, comprising more than 85 members from content delivery networks, design agencies, ISVs and solution providers. This will further fuel the adoption of Silverlight, and provide monetization opportunities for partners.

What’s momentum been like for Silverlight?

We continue to see a significant number of downloads of Silverlight on a daily basis. As more and more customers launch their own Silverlight applications, we expect that number to continue to grow.

Who is using Silverlight?

Here are a few customer highlights:

NBC/Olympics: NBC Universal has chosen to partner with Microsoft to make “NBCOlympics.com on MSN” the official online home of the 2008 Summer Olympics in Beijing, China. NBCOlympics.com on MSN will provide online users with exclusive access to an unprecedented offering of over 3000 hours of live and on-demand video content. The combination of MSN’s audience reach and Microsoft’s Silverlight technology will allow NBC to deliver Olympics content to a broad U.S internet audience - all through an immersive and interactive video experience that will redefine how sports fans consume content online.

Hard Rock: Hard Rock is using Silverlight to enhance its showcase of celebrity paraphernalia on its Web site. But, to give you an idea of what this entails, say a site visitor wants to check out Eddie Vedder’s guitar – the visitor could spin it in 3-D, perform a deep zoom and check on the scratches from when Eddie has banged it up on stage, etc. Some cool stuff to give fans closer access to celeb paraphernalia.

Weatherbug: Weatherbug is able to utilize Silverlight on Mobile Platforms as well as in a traditional PC/Mac environment to deliver a consistent user experience by re-using XAML assets across all platforms, in a cost effective manner by being able to use the same client side logic and back end services with only the need to customize some device specific keyboard and interaction handling.

Did Microsoft fund the deal with NBC to deliver the Olympics online via Silverlight?

Terms of the deal were not disclosed.

Will the NBC Olympics effort will run on NBC servers, MS servers or 3rd party servers?

The hosting is provided by a broad combination (MS/NBC/3rd parties)

How is Silverlight different than Flash? Flex? Adobe AIR?

Some of the scenarios for Flash and Silverlight usage are similar, such as rich media/video within websites, or interactive rich content for e-commerce, e-learning, or advertising. However, Silverlight uses a dramatically different approach for creating and delivering experiences in a way that aligns more with our customers’ development and deployment needs.

Platform: Microsoft’s client/web platform offerings span Windows to the Web, and include emerging surfaces such as the media/living room (Xbox360, Media Center PC), as well as mobile devices. Each of these platforms has shared capabilities and development tooling, but greatly different performance and integration characteristics. By comparison, Flash, Flex, and AIR are all variants of the Flash animation plug-in that Adobe acquired from Macromedia. They share a presentation and programming framework that was first developed for “skip-intro” and other pre-broadband experiences in the browser, and have incrementally evolved to add better programming, but lack the integration, performance, and tooling necessary to build many of the apps and content experiences that will be increasingly of interest to many businesses.

Tools: Silverlight, WPF, and ASP.NET AJAX share development and design tooling support with Microsoft Expression and Visual Studio product lines. With these tools, designers and developers can collaborate more effectively than ever before to design and implement superior UX. Adobe’s tooling and application frameworks are very focused on animation and cosmetic design, traditionally for the creative professional and not the application development audience.

Flex: For enterprise line of business (LOB) applications, Microsoft offers a breadth of solutions for building business applications that directly integrate with Microsoft Office, as integral parts of the Excel, Word, PowerPoint, and SharePoint Server experience. Flex is a new technology built on the Flash animation plug-in which allows developers to build richer Web-based UI and connections to server data. However, Flex lacks deeper integration into the environment where most of these LOB applications are used.

Adobe AIR: Web standards based development using AJAX is a proven technology for developing compelling and easy to deploy applications to the desktop with zero-touch requirements for additional client side infrastructure. Microsoft has shown continued innovation and commitment to this space with our Internet Explorer browser, our Live services, and our ASP.NET AJAX scripting capabilities for server code that delivers compliant Web standards to Mac and Windows clients.

Where experiences that more fully integrate with the desktop are of interest, .NET Framework can be used to build full-trust, fully-integrated applications for the Windows OS. [Windows Vista and the .NET Framework 3.0 are shipping now, and hundreds of ISVs are delivering applications that use these proven technologies for both LOB and consumer facing content and applications.

Adobe just released Flash 10 beta which includes support for features like 3-D and custom filters. When will Microsoft offer similar support with Silverlight?

Silverlight 2 supports managed code, includes the core of the CLR and adds over two dozen user interface controls (such as button, check box, date controls, gridview, layout, etc.) that are designed to be used right out of the box, or to be tweaked with styles. If you need full control over the look and feel, the appearance of any control can be fully determined by templates and control behavior can be modified by hooking events, or, ultimately by creating custom controls. Overall design is enhanced by new layout controls familiar from WPF and, Silverlight controls can provide one way or two way databinding to any number of data sources including LINQ, in a highly scalable architecture that abstracts out the binding object.

Because Silverlight 2 incorporates the core CLR classes, it provides much richer networking stack support, including REST, RSS, JSON and POX and full support for LINQ including LINQ to SQL and LINQ to XML. In addition to supporting C#, VB.NET and other managed code languages, Silverlight 2 includes support for Dynamic languages including Ruby and Python and a 2 way HTML/AJAX bridge for full integration of Silverlight with AJAX-enabled applications and Silverlight 2 provides secure client-side persistence through Isolated Storage.


EXPRESSION BLEND 2.5 JUNE 2008 PREVIEW

Is customer support offered with the Expression Blend 2.5 June 2008 Preview?

Support for pre-release products is offered on the Microsoft Discussion forum where you can solicit feedback and help get your questions answered by the Expression community. You can find the discussion forum here.

When will Expression Blend 2.5 be final?

We have not announced a release schedule for Expression Blend 2.5 however it is our intention to release it as soon as possible after Silverlight 2 is finally released.

When will Expression Studio 3 be released?

We have not announced a release schedule for Expression Studio 3.

Is Expression Blend 2.5 compatible with the tools in Expression Studio 2?

Yes.

Does Expression Blend support Silverlight 2?

Expression Blend will fully support Silverlight 2 in a future release. At TechEd we released an updated preview of Expression Blend 2.5 (Expression Blend 2.5 June 2008 Preview) to enable designers to start immediately exploring the power of Silverlight 2. We are currently evaluating how best to release this to market once Silverlight 2 is finally released, however we are committed to releasing preview versions to support the Silverlight 2 preview versions.

Customers who purchase Expression Studio 2 or Expression Blend 2 will receive the future version of Expression Blend that supports Silverlight 2 for free.

Are the features in Silverlight 2 Beta 2 exposed in Expression Blend 2.5 June Preview?

A large number of the features of the Silverlight 2 Beta 2 are available, specifically those which focus on the visual, design aspects of the platform.

Is Expression Blend 2.5 June 2008 Preview compatible with Visual Studio 2008 SP1?

Yes.

Where can I download Expression 2.5 2008 June Preview?

The preview can be downloaded from http://www.microsoft.com/expression/try-it/

Why isn’t the full Expression Studio included in MSDN Subscriptions?

We recognize the tremendous interest in the Microsoft Expression product line within the existing MSDN subscriber community and have included Expression tooling in the premium MSDN subscription levels as a result.

· Visual Studio Team System 2008 Team Suite with MSDN Premium includes Expression Studio.

· All other MSDN Premium levels include Expression Web and Expression Blend.

Developers with design responsibilities want access to Expression just as designers with development responsibilities want access to Visual Studio. We provide tooling for each group with the MSDN subscription levels above--for developers who do design--and the new Expression Professional Subscription--for designers who do development.

Which Expression products are included in each MSDN subscription level is a business decision reflecting our desire to continue meeting the needs of professional developers while delivering an "MSDN for Designers" option that appeals directly (and uniquely) to professional designers.

SILVERLIGHT TOOLS BETA 2 FOR VISUAL STUDIO 2008

What is the Silverlight Tools Beta 2 for Visual Studio 2008?

This package is an add-on to Visual Studio 2008 to provide tooling for Microsoft Silverlight 2 Beta 2. It provides a Silverlight project system for developing Silverlight applications using C# or Visual Basic. The project system includes:

· Visual Basic and C# Project templates

· Intellisense and code generators for XAML

· Debugging of Silverlight applications

· Web reference support

· Integration with Expression Blend 2.5 2008 June Preview

Do I need to download Silverlight Tools Beta 2 for Visual Studio 2008 to build Silverlight 2 applications?

Microsoft recommends downloading and using Silverlight Tools for Visual Studio to take advantage of features such as a visual design surface, intellisense, automatic build/packaging of XAP which makes it easier and more productive when building applications. It is a free add-on to VS. However, it is possible to build Silverlight applications using any text editor with the SDK.

Where can I download Silverlight Tools Beta 2 for Visual Studio 2008?

The easiest way to download the tools is to visit http://www.silverlight.net/

Monday, June 02, 2008

My Mobiler

I recently wrote a blog regarding the ActiveSync_Remote_Display (ARD) tool here that comes with Windows Mobile Power Toys.

Fellow MVP Peter Nowak told me about My Mobiler after reading my ARD blog post above. My Mobiler is a tool very similar to the ARD tool but better and best of all it's free.

There are a few things with My Mobiler that make remotely controlling your device from your desktop easier and more feature rich than ARD. Some of these features are as follows:

  1. Auto reconnect to your device after being previously connected via ActiveSync without having to close the application and reload it as you have to do in ARD.
  2. Automatic deployment of the device host (remote.exe) when you run the client tool on your desktop. This used to work with ARD in pre WM5.
  3. Support for landscape mode.
  4. Support for recording a video (very cool feature).
  5. Support for saving image to file or clipboard.
  6. System tray icon for quick access
Some screen shots are as follows:



Rotating the screen.



Result of copying the screen to the clipboard (contents of clipboard).


You can record video to an AVI which is quite neat for things like demoing etc. I've provided an example below of this.


Screen in landscape mode after invoking this from the tool.


Example of a recorded video using the record feature in the tool.

My ActiveSync_Remote_Display is now shelved :)

Sunday, June 01, 2008

HTC Touch Diamond

Another new cool device recently released from HTC named the Touch Diamond: http://www.htc.com/www/product.aspx?id=46278

Plenty of contracts available for this device here in the UK over at: http://www.expansys.com





















As you can see it looks quite impressive. If you go to the HTC home page, you can download a really cool video for this device: http://www.htc.com/www/default.aspx


Specification is as follows:

Processor Qualcomm® MSM7201A™ 528 MHz
Operating System Windows Mobile® 6.1 Professional
Memory ROM: 256 MB
RAM: 192 MB DDR SDRAM
Internal storage: 4 GB
Dimensions 102 mm (L) X 51 mm (W) X 11.35 mm (T)
Weight 110 g (with battery)
Display 2.8-inch TFT-LCD flat touch-sensitive screen with VGA resolution
Network HSDPA/WCDMA:
  • Europe/Asia: 900/2100 MHz
  • Up to 384 kbps up-link and 7.2 Mbps down-link speeds
Tri-band GSM/GPRS/EDGE:
  • Europe/Asia: 900/1800/1900 MHz

(Band frequency and data speed are operator dependent.)

Device Control TouchFLO™ 3D
Touch-sensitive navigation control
GPS GPS and A-GPS ready
Connectivity Bluetooth® 2.0 with EDR
Wi-Fi®: IEEE 802.11 b/g
HTC ExtUSB™ (11-pin mini-USB 2.0 and audio jack in one)
Camera Main camera: 3.2 megapixel color camera with auto focus
Second camera: VGA CMOS color camera
Audio Built-in microphone, speaker and FM radio with RDS
Ring tone supported formats:
  • MP3, AAC, AAC+, WMA, WAV, and AMR-NB
  • 40 polyphonic and Standard MIDI format 0 and 1 (SMF)/SP MIDI
Battery Rechargeable Lithium-ion or Lithium-ion polymer battery
Capacity: 900 mAh
Talk time:
  • Up to 270 minutes for WCDMA
  • Up to 330 minutes for GSM
Standby time:
  • Up to 396 hours for WCDMA
  • Up to 285 hours for GSM
Video call time: Up to 145 minutes for WCDMA
(The above are subject to network and phone usage.)
AC Adapter Voltage range/frequency: 100 ~ 240V AC, 50/60 Hz
DC output: 5V and 1A

I will be putting my order in soon!!...