ObjectSharp Blogs

You are currently viewing

Dave Lloyd's 2 Cents

A .NET Developer's Perspective


Silverlight on the Silver Screen

You don’t want to miss this. It’s going to be great.

July 9th 2009 at the Scotia Bank Theatre

star_wars_smsilver_thunder_sm

No CI Build on Check-in

Found this out just this past week. What a great tip. Thanks Colin Bowern by way of Buck Hodges

Have you ever wanted to check something in without kicking off the CI build?

All you have to do is put ***NO_CI*** in the check in comment.

Now I will never forget.

Business Intelligence Smart Breakfast

If you want to learn what your data can do for you. You should attend The next ObjectSharp Smart breakfast with David Chennells.

Click on the image below for more information and to register.

Twitter

Although I have been twittering, I have also been struggling with its usefulness. Frankly I don’t care what you had for dinner, or how you golfed yesterday.

There is certainly good info on the web that people broadcast that I may not have come across on my own. To date that was the driving force to Tweet and follow, for me.

However, I attended a MS event yesterday and the first speaker talked about a bakery in London that tweets when a batch of bread is coming out of the oven. Using a Baker Tweet device. The bakeries followers can then follow a link to a picture of the product and a map to the location.

I have to admit this put a new light on Twitter for me. Knowing what someone is doing right now seems pointless to me, but finding out a batch of rye just came out of the oven is useful.

Twitter is like an event broker. If I want to execute my buy fresh bread event when the bread is at it’s freshest. I just subscribe to the service and twitter sends the event publication. Twitter makes it possible for the execution of that event to be in sync with the bread coming out fresh from the oven. In the past it fired when I wanted fresh bread but that did not mean the bread was fresh.

Now that I am seeing twitter for what it really is, the possibilities are endless.

Using the WPF DockPanel

For those WinForm developers that are familiar with the Dock Property of Win32 controls, you may be looking for Fill as a DockPanel.Dock value in WPF. There isn’t one. Not to worry docking is easier with the DockPanel then it was in WinForms.

In WinForms, when using the Dock property didn’t result in the look you expected, The way to fix it up was to open the Document Outline window and reorder the controls you were docking. The order along with the Dock property value dictated how the controls would be laid out.

This is also true in WPF. When using the DockPanel you will notice there are four Dock options to select from Bottom, Top, Right and left. There is no fill. However the order of the controls will determine which one fills the panel.

When laying out a DockPanel think of it this way. Your controls will be placed in the panel in the order you have them listed in the XAML. The examples below show how changing the order of the controls changes how the controls are docked. 

When the first control is docked Left it is occupying the whole left side of the DockPanel. While the last control will fill the remaining space in this case the control docked to the Bottom.

 

<DockPanel>
        <Button DockPanel.Dock="Left">Left</Button>
        <Button DockPanel.Dock="Top">Top</Button>
        <Button DockPanel.Dock="Right">Right</Button>
        <Button DockPanel.Dock="Bottom">Bottom</Button>
    </DockPanel>

image
Putting Top first, makes it occupy the whole top, then with bottom second it occupies the whole bottom. Left goes in between, and Right fills the remainder of the DockPanel.  

<DockPanel>
    <Button DockPanel.Dock="Top">Top</Button>
    <Button DockPanel.Dock="Bottom">Bottom</Button>
    <Button DockPanel.Dock="Left">Left</Button>
    <Button DockPanel.Dock="Right">Right</Button>
</DockPanel>

image
This example shows how this rule holds true even when more then one control has the same docking.  

<DockPanel>
    <Button DockPanel.Dock="Left">Left 1</Button>
    <Button DockPanel.Dock="Top">Top</Button>
    <Button DockPanel.Dock="Bottom">Bottom</Button>
    <Button DockPanel.Dock="Left">Left 2</Button>
    <Button DockPanel.Dock="Right">Right</Button>
</DockPanel>

image

Happy Docking!

Google Alerts made me laugh :)

I subscribe to Google Alerts. I have an alert set up to look for the word ObjectSharp. This has worked great over the years, pointing out blogs and articles where people have made reference to ObjectSharp.

This morning I received an Alert that made me laugh.  I started reading a news article titled: Here's how and where 'cutters' can get help

Perhaps its someone talking about our training, I thought to myself. As I began to read the article it made no sense. Then I found the source of the Alert. :)

image

You understand, it made me laugh because of the mix up , not that the article is funny. The Article is very serious and I hope these people get some help.

Dundas Charts in the .Net Framework 3.5 SP1?

It's true. We were looking at using Dundas charts for a client project. One of our associates mentioned that Dundas sold the rights to their Data Visualization packages to Microsoft last year and have added them as a separate installation for .Net framework 3.5 SP1. Read more about it here.

What do I need and where do I get it?

For some help using them check out Chart Forums and Chart Samples

DevTeach Montreal

Have you heard the news?

Every attendee to DevTeach Montreal will get Visual Studio 2008 Pro, Expression Web 2 and Tech-Ed DEV set in their bag!

DevTeach believes that all developers need the right tool to be productive. Therefore you will get,  free software, when you register to DevTeach or SQLTeach. Yes that right! They are giving over a $1000 worth of software when you register to DevTeach. You will find in your conference bag a version of Visual Studio 2008 Professional, ExpressionTM Web 2 and the Tech-Ed Conference DVD Set. Now that is a good deal? DevTeach and SQLTeach are really the training you can’t get any other way.

Register now.

 

clip_image001clip_image002clip_image003

Windows 7

At PDC everyone got a Windows 7 DVD. I used it at the conference on machines that were set up for people to use and it seemed pretty good. I have an older laptop I was going to get paved to use as a back up when this one has trouble. So I thought I would try it out on that machine, nothing to lose.

I was very impressed with the easy install. I have installed pretty much every version of windows since version 3 at one time or another. I would have to say this was the quickest and most pain free ever.

After playing around with it a little (keep in mind there is very little software on it to play with so far) it's snappy. I mean really responsive.

It seems like a much better Vista rather then a new operating system.

So far I give it a big thumbs up. :)

Microsoft Research Part II

On the plane going to PDC Bruce mentioned a new product from MSR that he had downloaded called Pex. Then when the Expo hall opened at PDC we eventually made our way to the MSR section of the hall. There was Pex. We watched an excellent and very enthusiastic demo, at the end we were told there would be a session first thing Thursday morning. That would be the last thing we do before heading for home.

Thursday morning we arrive at the Convention centre for Breakfast, randomly select a table and settle in for breakfast with four other PDCer's. Turns out two of them work for MSR and are giving the talk on Pex this morning. :) It was meant to be, how many signs does one need.

As it turned out Bruce decided to find out how MS uses VSTS internally instead of both of us attending the Pex talk. so we split up.

The Pex talk turned out to be two talks.

Code Contracts

Code contracts will be coming in 4.0 and will allow you to add contracts to your classes and methods to express assumptions about the code. These contracts can be used to:

    1. Improve testing via runtime checking
    2. Static contract verification
    3. Documentation generation

    public virtual int Add(object value)
    {
            Contract.Requires( value != null );
            Contract.Ensures( Count == Contract.OldValue(Count) + 1 );
            Contract.Ensures( Contract.Result<int>() == Contract.OldValue(Count) );
            if (count == items.Length) EnsureCapacity(count + 1); 
            items[count] = value; 
            return count++;
    }

Pex

Pex is an automated white box testing tool, that will interrogate your code and build a table of possible inputs to your code that would execute all code paths. From this table of possible test cases you can generate unit tests. If an unhandled exception is found it will show up in bold, once you create the unit test you can then run the test and debug directly into the code path that causes the exception. All from the Pex UI. Very nice demo.

This is definitely worth a look. There are two versions you can download today. One works with the 2010 CTP and an academic release that works with VS 2008.

More Posts Next page »