Andrej Tozon's blog

In the Attic


't was a Live Beta Day

Three Live Betas rolled out yesterday:

Windows Live Writer Beta 2 shows qute some progress. I like the new, "Live" look, including semi-transparent splash screen. Many new features include table editing, link glossary, better pasting, plug-in management (Insert Messenger Quote plugin appears to continue working with this beta).

Windows Live Messenger 8.5 Beta, on the other hand, seems to bring mostly UI enhancements (again). The good news is that future WLM Updates will be rolled out through Windows Update

There's also Windows Live Mail Beta 2, which I haven't tried yet, but its UI looks in sync with the other two.

Client Application Services - NTK2007 Sample

Attached to this post is the CAS sample I've been presenting on NTK2007, translated to English. Here's couple of notes about setting it up and taking it further:

1. The ("Orcas") solution contains two projects: ClientServices is a web project, serving CAS to the Windows Forms Client (ClientApplication).

2. ClientServices web project doesn't include the Membership database, you'll have to create your own [Visual Studio can create one for you automatically]. With the provided Configuration web tool, set up as many users as you like and create at least two roles: Administrator and PowerUser. Don't forget to switch to Forms authentication.

3. With ClientServices web project set up, configure ClientApplication to use the service. There's a new configuration tab called Services in ClientApplication properties pages. Point all the addresses to the address ClientServices is listening on.

This should get you going... A couple of things to note:

1. Checking the "Remember me" checkbox on the Login dialog acts the same as you'd expect from a web application - the application will automatically log you in on the next run. Log out button will clear this state and force you to enter your credentials manually again.

2. When a user, logging in, is in "Administrator" role, main form's title will reflect that:

Similarly, when a user, not in PowerUser role, clicks the "Say Hello" button, she will get a "No permission" message. This example is showing off declarative code access security.

By default, roles are set up to be cached for 1 day, which means that adding or removing a user from particular role won't have immediate effect on how application handles this role. To change this setting, click on the "Advanced" button on Service's tab:

... just be careful - setting the Role service cache timeout to 0 means that your application will call the service each and every time it needs to check whether current user is in specific role, either demanded imperatively or declaratively.

3. When you declare new profile properties in your profile service, you'll be able to use those as your application properties; just select Load Web Settings on the Settings tab to get them to your client application.

The fun part is that you can bind these properties to your user controls as you were used to with VS2005 applications, except that settings won't be read/written to your local configuration files, but rather to your remote, centralized profile/settings store.

As you can see from the enclosed sample, there's very little code that had to be written for all this to work.

Download the sample code.

Also see some of my previous posts on CAS:

Client Application Services in Windows Forms - The Walkthrough

I was just about to record my first screencast on Client Application Services I was presenting a week ago on local NT Konferenca, when this post popped up in my feeds aggregator - Karl Erickson posted a CAS Walkthrough document, overviewing CAS features, coming with Visual Studio "Orcas".

I started playing with CAS a couple of months ago, when there were virtually no documentation available on this subject, and I'm glad these cool little services are beginning to get a little more attention.

Anyway, if you want to see my screencast anyway, or are just looking for some additional sample code on Client Application Services, post a comment here. I'll be posting my presentation's sample code on my blog shortly.

NTK2007 sessions materials

I'm posting materials from my sessions on this year's NT konferenca:

Windows Forms, Windows Presentation Foundation and... Visual Basic 6? Hands-On-Lab: Powerpoint | Sample code | Step-By-Step Manual

Notes: Northwind data files are not included, NORTHWND.MDF and NORTHWND_log.LDF, placed in this zipped download just serve as placeholders. The code samples were created with Visual Studio "Orcas" and VB6.

Visual Studio "Orcas": What's new with Smart Client Development: Powerpoint


This year's NT Konferenca, starting next week, is kind of anniversary event for me - it's the 10th time I'm attending this conference, 5th time as a speaker, 1st as an MVP...

For the content I'm presenting... If you're interested in meeting with the new VS "Orcas" Beta 1 in person or just want to shake hands with your old friend VB6, you're invited to my "WF, WPF and... VB6?" Hands-On-Lab session on Tuesday. You'll have a chance to run Orcas and VB6 side-by-side, compare their performances, and possibly even learn something about how you can mix and interop Windows Forms, Windows Presentation and VB6 applications [which is something you may consider if you're planning to upgrade or enhance your existing applications with better technology].

My talk on Wednesday will focus on some of the new features regarding Smart Client development, coming with Orcas and .NET Framework 3.5: I'll talk about Client Application Services, SQL Server Compact Edition,  ADO.NET Synchronization Services [in my opinion, this is one of the features we're all going to love and use frequently], and more.

Although this year's conference was shortened to 3 days only, this doesn't show on the content - the sessions look fresh and interesting.

Enjoy the conference and I hope to see you there.