The mysteries of software development and networking... RSS 2.0



 Monday, May 08, 2006

I generally don't bookmark too much, between the history in the address bar and Googling there is just little that requires it, today I found a link that is useful to check on a more regular basis though.

Microsoft has a page where you can find all the latest versions for their SDK's.

Link: http://www.microsoft.com/downloads/Browse.aspx?displaylang=en&aud=5&dctypeid=25

Monday, May 08, 2006 6:14:58 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Monday, May 01, 2006

My article on 'Getting started with WPF' has been published in the Software Developer Magazine and can also be read online at www.sdn.nl

Monday, May 01, 2006 11:27:07 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF

The Maine Developer Network is a new .NET user group. Recently founded we organize a monthly meeting in Augusta, ME.

Interested? Read more on www.maine-devnet.org

Monday, May 01, 2006 10:11:37 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Saturday, April 15, 2006

This site show a very good example of why software patents are a bad idea: http://webshop.ffii.org/

Hint: each number in the picture is a patent violation.

Saturday, April 15, 2006 3:28:02 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Wednesday, April 12, 2006

MSBee is an addon for MSBuild which allows you to use MSBuild to build your .NET 1.1 projects.

=== Start Quote ===

Since the release of MSBuild in .NET Framework 2.0, a very frequent customer request has been to provide a means for MSBuild to build .NET 1.1 applications. This demand stems from users who want to use Visual Studio 2005 and .NET 2.0, but need to continue servicing customers who use .NET 1.1.

MSBuild Extras – Toolkit for .NET 1.1 “MSBee” is an addition to MSBuild that allows developers to build managed applications in Visual Studio 2005 that target .NET 1.1.

=== End Quote ===

Link: http://msdn.microsoft.com/vstudio/downloads/tools/msbee/default.aspx

Wednesday, April 12, 2006 8:50:14 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Tuesday, April 11, 2006

I love it when best practices get incorporated into tools to help you actually follow them in an easy and intuitive way. ServiceBAT, released by the Microsoft Patterns & Practices team, seems to bring a bunch of basic principle of Service Oriented Architecture into Visual Studio with a package called the Service Baseline Architecture Toolkit (ServiceBAT) project. 

Edward Bakker has a great post on his blog with demo screenshots.

The download can be found on GotDotNet. It still all very much beta!

WSCF - Schema-based Contract First Web Services by ThinkTecture is another great tool which takes a similar approach, but also improves the WSDL for your web service.

Tuesday, April 11, 2006 11:22:46 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Architecture

Rocky Lothka has an interesting quote when he talks about Object Oriented designs:

"Reuse leads to coupling, coupling leads to high cost, high cost leads to anger, and anger leads to the dark side"

Now this is not just true for object orientation, it also applies to (web) services. Applications that use multiple web services and thus depend on multiple external systems are 'coupled'. Although at a technical level technologies like web services make that there is no binary dependency the logical, or business dependency is still very much there.

Headaches to ponder:
- How does my app behave when the web service is unavailable?
- What is the 'business' consequense of the technical solution for your chosen solution?
- How to deal with backup and restore if multiple systems go down?
  Or if just one goes down for that matter.

 

Tuesday, April 11, 2006 10:59:56 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Architecture

I was just wondering whether it would be difficult to create my own URL like application. I would like to be able to surf to 'myApp:test'.

I guess it starts in the registry.

Here is what I found on MSDN ( http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/overview/appendix_a.asp ):

---

To enable an application to handle a particular URL protocol, you must add a new key, with the appropriate keys and values, to the registry in HKEY_CLASSES_ROOT.

The new registry key must match the protocol scheme that is being added. For instance, to add the protocol note:, the key added to HKEY_CLASSES_ROOT should be note. Under this new key, the Default string value should be the name of the new protocol, and the URLProtocol string value should contain either protocol-specific information or an empty string. Also under the new key, a DefaultIcon key and a shell key should be added. The Default string value under the DefaultIcon key must be the file name to use as an icon for this new URL protocol. Under the shell key, a key using a verb (such as open) should be added. A command key and a DDEEXEC key can be added under the key using a verb. The values under the command and DDEEXEC keys are used to call the application.

The following example shows which registry values must be added to register a new application (notepad.exe in this example) to handle a new URL protocol (note:).

[HKEY_CLASSES_ROOT]
    [note]
        (Default) = "URL:Note Protocol"
        URL Protocol = ""
        [DefaultIcon]
            (Default) = "notepad.exe"
        [shell]
            [open]
                [command]
                    (Default) = "c:\windows\notepad.exe %1"

By adding these settings to the registry, attempts to navigate to URLs such as note:c:\myfile.txt would launch Notepad to edit the file c:\myfile.txt. Of course, all the commands supported under Shell\Open are supported, including DDEEXEC (in other words, "command" is not the only key you can put under the verb).

Tuesday, April 11, 2006 8:46:19 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Tuesday, March 28, 2006

You can now download the powerpoint from my 'Introduction to WPF' session on the download page at www.develop-one.com.

Or download directly from this link: Introduction to WPF.ppt

 

Tuesday, March 28, 2006 8:19:33 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF
 Wednesday, March 22, 2006

Microsoft has released a press statement announcing that Windows Vista consumer availability has been scheduled for January 2007.

 

Below is the original statement:

REDMOND, Wash. — March 21, 2006 — Microsoft Corp. today confirmed that Windows Vista™, the next generation of the Windows® client operating system, is on target to go into broad consumer beta to approximately 2 million users in the second quarter of 2006. Microsoft is on track to complete the product this year, with business availability in November 2006 and broad consumer availability in January 2007.

Windows Vista will deliver great value to businesses by seamlessly connecting people to information, enabling increased mobile and remote productivity, significantly reducing deployment and support costs, and providing a more secure and compliant desktop platform. For consumers, Windows Vista will bring clarity to the world of personal computing, enabling people to more safely and easily accomplish everyday tasks, instantly find what they want, enjoy the latest in entertainment, and stay connected at home or on the go.

More than half a million customers have received the latest community technology preview for Windows Vista, and have been providing consistent and positive feedback.

“Product quality and a great out-of-box experience have been two of our key drivers for Windows Vista, and we are on track to deliver on both,” said Jim Allchin, co-president for the Platforms & Services Division at Microsoft. “But the industry requires greater lead time to deliver Windows Vista on new PCs during holiday. We must optimize for the industry, so we’ve decided to separate business and consumer availability.”

Because of the way businesses test and deploy software, it makes sense for Microsoft volume licensing customers to receive windows Windows Vista starting in November of this year. Availability for consumers and on new PCs will follow in January.

“We strongly support Microsoft’s decision to prioritize quality in determining the schedule for Windows Vista,” said Todd Bradley, executive vice president of the Personal Systems Group at Hewlett Packard. “A January launch of Windows Vista allows us to execute in a consistent way throughout the holidays, and will provide the right opportunity for a large, exciting launch industrywide after the New Year.”

Said Ron Boire, executive vice president and general merchandising manager at Best Buy, “When people come to our stores to buy a new PC or new software for their PC, we want to be able to offer them a broad set of choices, immediate availability and a great retail experience. We agree with Microsoft that it’s best to do this right — and in this case it’s delivering Windows Vista-based PCs with confidence in January 2007.”

Wednesday, March 22, 2006 3:43:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Friday, March 17, 2006

Rockford Lhotka has a very interesting post about whether or not all developers are equal.

http://www.lhotka.net/WeBlog/AllInAllWereJustAnotherBrickInTheWall.aspx

 

Friday, March 17, 2006 2:43:14 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Friday, March 10, 2006

Beth Massi has an interesting post about the performance of DataSets when using Binary Serialization.

Read more: http://bethmassi.blogspot.com/2006/01/binary-serialization-of-datasets-in.html

Friday, March 10, 2006 2:30:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C#

I'm working on a WinForm 2.0 window on which I have a DataGridView.

The DataGridView is connected to an ObjectDataSource and the datasource of this ObjectDataSource is pointing to an array of items.

This works nicely, however, the user can use a popup to add an entry to the array. The DataGridView will not automatically detect that the underlying array has changed.

Solution: Call BindingSource.ResetBindings(..) after updating the array. This will raise an event which makes the DataGridView redraw itself.

Friday, March 10, 2006 10:01:38 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C# | General
 Wednesday, March 08, 2006

Microsoft Live Search is the new search engine from Microsoft. Will it be able to nibble at google's marketshare?

We'll see. Go to: http://search.live.com

 

:-)

 

Wednesday, March 08, 2006 5:25:06 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General | Vista
 Monday, March 06, 2006

With WPF we are far more flexible in creating UI solutions since now almost every control can contain other controls.

The classic example being ofcourse the button.
A button cannot just have a text on the surface of the button, it can just as easily have an image.

Example of button with text.

<Button Name="button1">Just text</Button>

Example of button with image.

<Button Name="button1">
 <Image Source="C:\Documents and Settings\Mark\Desktop\banner.jpg" Name="image1" Width="100"/>
</Button>

Now a lot of buttons will have an image and also some text.
With our HTML background we'll probably attempt:

<Button Name="button1">
 Just text<br/>
 <Image Source="C:\Documents and Settings\Mark\Desktop\banner.jpg" Name="image1" Width="100"/>
</Button>

Wrong! A button can contain controls, but has no 'knowledge' of how to produce a layout for multiple controls.
WPF has special controls that provide layout implementation. These are panels. There are four kinds of panels:
- DockPanel
- StackPanel
- Grid
- Canvas

The same is actually true of the Window control. A Window has no 'default' knowledge of layout. VS2005 will by
default add a 'Grid' control as the root panel.

A StackPanel is easiest to use. It will stack items either horizontally or vertically.
In our button example we would want to use the StackPanel as the child of our Button.

<Button Name="button1">
  <StackPanel Orientation="Vertical">
    <TextBlock>Just text</TextBlock>
    <Image Source="C:\Documents and Settings\Mark\Desktop\banner.jpg" Name="image1" Width="100"/>
  </StackPanel>
</Button>

Notice that we don't need the <BR> tag anymore.
The linefeed is really layout information and our StackPanel is in charge of layouting the content.
If however we have a lot of text, then we could put a newline within the TextBlock.

<Button Name="button1">
  <StackPanel Orientation="Vertical">
    <TextBlock>
      Just text
      <LineBreak/>
      The next line
    </TextBlock>
    <Image Source="C:\Documents and Settings\Mark\Desktop\banner.jpg" Name="image1" Width="100"/>
  </StackPanel>
</Button>

A Grid offers more options and acts much more like a table with rows and columns. I'll show a quick example:

<Grid ShowGridLines="True">
  <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    <ColumnDefinition/>
    <ColumnDefinition/>
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition/>
    <RowDefinition/>
  </Grid.RowDefinitions>
  <TextBlock Grid.Column="0" Grid.Row="0">Top left</TextBlock>
  <TextBlock Grid.Column="1" Grid.Row="1">Middle</TextBlock>
  <TextBlock Grid.Column="2" Grid.Row="2">Bottom right</TextBlock>
  <Image Source="C:\Documents and Settings\Mark\Desktop\banner.jpg" Name="image1"
      Width="50" Grid.Column="1" Grid.Row="0"/>
</Grid>

As you can see the content of an actual cell is not placed in the cell, but instead the content is listed below the column and row definitions. I must say that I'm still getting used to this notation.

The DockPanel allows you to dock content to a border of the window.
The Canvas panel performs no layout functionality, you're in charge of all layout matters. Much the way 'regular' WinForms let you do all the layouting.

 

Monday, March 06, 2006 8:51:07 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF
 Sunday, March 05, 2006

WPF introduces EventBubbling. People who have done scripting in Internet Explorer will find this very familiar. The concept is that an eventhandler may not be implemented on a GUI-control, but can also be implemented on the parent of that GUI-control. When an event is fired it will traverse the tree from child to parent to parent to parent until it reaches the top control, usually the window.

Let's look at a demo.

Below is the XAML file for Window1.

<Window x:Class="Demo3.EventHandling.Window1"
    xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
    xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
    Title="Demo3.EventHandling"
    >
    <Grid>
    <Button VerticalAlignment="Stretch" Click="button1_Click"
            HorizontalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="1"
            Grid.Row="0" Grid.RowSpan="1" Margin="80,85,77,121"
            Width="NaN" Height="NaN" Name="button1">
      <StackPanel Orientation="Vertical">
        <Image Source="C:\Documents and Settings\Mark\Desktop\banner.jpg" Name="image1"/>
        <TextBox Name="textbox1" Text="Type your name here!" Height="20" Width="333" />
        <Button Name="innerButton" Click="innerButton_Click">Press me!</Button>
      </StackPanel>
    </Button>
  </Grid>
</Window>

Here is the code.

void button1_Click(object sender, RoutedEventArgs e)
{
    MessageBox.Show("Hello " + this.textbox1.Text);
    Button source = e.OriginalSource as Button;
    if (source != null)
    {
        MessageBox.Show("The original source is: " + source.Name);
    }
}

void innerButton_Click(object sender, RoutedEventArgs e)
{
    MessageBox.Show("Hello SDN!");
}

This will look like:


Just click on the various controls. Notice that controls that do not have a 'Click' event do not participate in the routing, but may still pass the event on.

In WPF this concept is called event routing. You can halt the routing of an event by setting

e.Halted = true;

 

 

Sunday, March 05, 2006 4:37:49 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF

In the System.Windows namespace there is an 'Application' object. Your application should make use of this class since it allows for lifetime tracking through events like StartUp and SessionEnding and methods like Run.

We can expand our hello world to:

using System;
using System.Windows;


namespace HelloWorld
{
    public class MyApp : Application
    {
        [STAThread]
        static void Main(string[] args)
        {
            MyApp app = new MyApp();
            app.Startup += app.OnApplicationStart;
            app.Run(args);
        }


        void OnApplicationStart(object sender, StartupEventArgs e)
        {
            Window w = new Window();
            w.Title = "Mark says: Hello World!";
            w.Show();
        }
    }
}

With a little bit of digging around you can find the code that Visual Studio uses for initializing the application:


public partial class MyApp : System.Windows.Application
{
    /// <summary>
    /// InitializeComponent
    /// </summary>
    public void InitializeComponent()
    {
        this.StartupUri = new System.Uri("Window1.xaml", System.UriKind.Relative);
        System.Uri resourceLocater = new System.Uri("myapp.baml", System.UriKind.RelativeOrAbsolute);
        System.Windows.Application.LoadComponent(this, resourceLocater);
    }



    /// <summary>
    /// Application Entry Point.
    /// </summary>
    [System.STAThreadAttribute()]
    public static int Main(string[] args)
    {
        System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.STA);
        MyApp app = new MyApp();
        app.InitializeComponent();
        return app.Run(args);
    }
}

As you can see some resources are initialized in the InitializeComponent. By default the VS2005 WinFx project sets up some resources, you find them under the 'Properties' folder. Also an URI is set to track the initial window. This URI is the window that will be started when app.Run(..) is executed.

 

Sunday, March 05, 2006 3:40:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF

Time to continue with WPF.

You don't need to use XAML to program WPF. Quite the contrary. Everything you can do with XAML you can do with C#. It's just a matter of using the right tool for the right job. It doesn't make much sense to do all the layout code in C#, XAML will hopefully do a better job there. Anyway, just to prove the point I have to start where every new technology starts: Hello World!

I've installed all the necessary tools. I've started VS2005 and created a new WinFx application.
The application by default holds references to all relevant assemblies, these being:
- PresentationCode
- PresentationFramework
- ReachFramework
- UIAutomationProvider
- UIAutomationTypes
- WindowsBase

The names of these assemblies don't look very RTM-like, so I have to assume they'll change in one of the upcoming CTP's or RTM.

I like to start as clean as possible, so I throw out all the stuff under the properties folder and also the default created MyApp.xaml and Class1.xaml.

Now add a new class called HelloWorld:


using System;
using System.Windows;  //This is the WPF namespace

namespace HelloWorld
{
    public class HelloWorld
    {
        [STAThread]
        public static void Main()
        {
            // This is the System.Windows.MessageBox
            MessageBox.Show("Hello SDN!");           
        }

    }
}

Startup the application and go!

Sunday, March 05, 2006 3:16:26 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF
 Saturday, March 04, 2006

An interesting thread is going on at Ted's blog: http://blogs.tedneward.com/Trackback.aspx?guid=5f213ccd-5acb-4c81-9ec3-23b20db68447. I've put my 2 cents in, so read the comments.

Saturday, March 04, 2006 9:07:46 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Thursday, March 02, 2006

Mike Henderlight blogs that the "Crossbow"-technology will actually be part of WPF.

"We have spent the last several months working very hard on developing and executing on a plan where we could deliver the Crossbow runtime as an integral part of WPF.  As of the Beta2 release of WPF, the Crossbow runtime will be part of the WPF redist and reside in the GAC just like all of the other WPF components.  And from that point forward we will be on the WPF ship schedule which means that we will RTM with WPF."

This is great! The Crossbow-technology has been created by a seperate team within Microsoft, but I'm sure when WPF hits the streets most developers will assume this to be a very "oh yeah, there is interop with WinForms, what's new" kind of feature. You know? One that everyone expects to be there, but is really very very cool.

Thursday, March 02, 2006 1:45:24 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF
About
This blog is run by Mark Blomsma.
© Copyright 2008
Develop-One
Sign In
Statistics
Total Posts: 337
This Year: 81
This Month: 0
This Week: 1
Comments: 94
All Content © 2008, Develop-One
DasBlog theme 'Business' created by Christoph De Baene (delarou)