Blog

posts by Fons Sonnemans

What is an architect?

0 Comments
By Fons Sonnemans, 29-sep-2005

I just saw the great Sparkle video on Channel9. On of the most funny part was the question 'What is an Architect?'. The anwer from John Gossman was 'It is a fancy title for a programmer' or in other words 'You are old'. I hope you enjoy the movie, I did. I can't wait to play with it.

Tags: Work

READ MORE

Avalon and ClickOnce demo

0 Comments
By Fons Sonnemans, 23-sep-2005

I have build my first Windows Presentation Foundation (WPF) application. It is a remake of my WinForms Minesweeper game. Go to the ClickOnce publisher page and install Avalon Minesweeper.

Make sure you have the Microsoft Pre-Release Software WinFX Runtime Components - September Community Technology Preview (CTP) installed on your computer.

To run this sample you must add 'http://www.mydotnetplayground.nl/WpfMinesweeper' to your Trusted Sites in Internet Explorer.

UPDATE 1-1-2006: Moved to my own provider and updated to the December CTP.

Tags: WPF, CSharp

READ MORE

SDE Slides

0 Comments
By Fons Sonnemans, 20-sep-2005

The slides from my presentation 'NDoc Integratie in Visual Studio 2003 & 2005' can now be downloaded.

READ MORE

C# 3.0 looks like Smalltak

0 Comments
By Fons Sonnemans, 14-sep-2005

Many years ago I programmed in Smalltalk (Enfin which later became ObjectStudio). I have always liked it although it was not very programmer friendly (no IntelliSense). I have just wachted this C# 3.0 Language Enhancements in action video. The shown Extension Methods feature realy looks like the Secondary Class files of Smalltalk. Nice to see them back, they where very handy.

In the following example I have added the 'IsPrime()' method to the 'Int32' type. The 'this' keyword in front of the 'number' parameter of the IsPrime() method did the real trick. This makes it an Extension Method.

class Program {
    static void Main(string[] args) {
        Console.WriteLine(5.IsPrime()); // true
        Console.WriteLine(9.IsPrime()); // false
        Console.WriteLine(23.IsPrime()); // true
    }
}

static class Extensions {

    public static bool IsPrime(this int number) {
        if (number == 1 || number == 2 || number == 3) {
            return true;
        }
        if ((number % 2) == 0) {
            return false;
        }
        int sqrt = (int)Math.Sqrt(number);
        for (int t = 3; t <= sqrt; t = t + 2) {
            if (number % t == 0) {
                return false;
            }
        }
        return true;
    }
}
Tags: CSharp

READ MORE

PDC05 Keynote

0 Comments
By Fons Sonnemans, 13-sep-2005

I have just watched the live PDC05 Keynote Webcast. I'm very impressed. Great demo's showing LINQ, Indigo, Atlas and Avalon. The problem for Microsoft will be to get us 'the developers' to use these new technologies as soon as possible. I'm afraid it is all to much for a 'normal' developer too cope with.

READ MORE

SDN Software Developer Event

0 Comments
By Fons Sonnemans, 30-aug-2005

I will be speaking at the SDN Software Developer Event on the September 16 2005, De Reehorst - Ede . I will talk about the integration of NDoc with Visual Basic 2003 and 2005. Hope to see you there.

READ MORE

My Favorite Visual Studio 2005 and .NET 2.0 features

0 Comments
By Fons Sonnemans, 05-aug-2005
  • C# 2.0
  • Class Designer
  • Unit Testing
  • Code Coverage
  • FXCop Integration
  • Debugging: DataTips, Visualizers and Viewers
  • Refactoring
  • Improved IntelliSense
  • Code Snippets
  • Profiles
  • Strongly-typed resource class generator
  • Improved (not perfect) Windows Forms controls

READ MORE

Binary Compatiblity

0 Comments
By Fons Sonnemans, 22-jul-2005

Microsoft has released a free LibCheck tool that allows you to compare two versions of an assembly, and determine the differences. The tool reports the differences as a combination of 'removed' and 'added' APIs. The tool is limited to looking only at APIs (i.e, it can't check for behavioral changes), and only compares public differences, or changes which are deemed to be 'breaking'. The tool can be used to quickly determine what has changed between one version of your assembly and another, and can help ensure that you won't introduce any breaking changes to clients of your assembly. Instructions and intended use of the tool are described in the 'libcheck tool specification' document with the zip file.

This was a feature I always was missing. VB6 had this, VS.NET didn't. Thanks MS.

READ MORE

AsyncHelper for VB.NET

0 Comments
By Fons Sonnemans, 21-apr-2005

I received a mail today from Rolf Gasber asking me whether I could help him with a VB.NET version of the AsyncHelper which I used in an earlier post. Here it is:

Public Class AsyncHelper

    Private Delegate Sub DynamicInvokeShimProc(ByVal d As [Delegate], _
                                
ByVal args() As Object)

    Private Shared _dynamicInvokeShim As _
                                 
New DynamicInvokeShimProc(AddressOf DynamicInvokeShim)

    Private Shared _dynamicInvokeDone As _
                                  
New AsyncCallback(AddressOf DynamicInvokeDone)

    Public Shared Sub FireAndForget(ByVal d As [Delegate], _
                                 
ByVal ParamArray args() As Object)
        _dynamicInvokeShim.BeginInvoke(d, args,
AddressOf _
                                
 DynamicInvokeDone, Nothing)
    End Sub

    Private Shared Sub DynamicInvokeShim(ByVal d As [Delegate], _
                                  
ByVal args() As Object)
       d.DynamicInvoke(args)
    End Sub

    Private Shared Sub DynamicInvokeDone(ByVal ar As IAsyncResult)
      
_dynamicInvokeShim.EndInvoke(ar)
    End Sub

End Class

Tags: VB

READ MORE

Microsoft has put my 'Dual List' .NET Magazine article online!

0 Comments
By Fons Sonnemans, 09-apr-2005
 

Microsoft has put my Visueel programmeren met .NET: Dual List Control article online. It is published in the .NET Magazine #8 and it is free for Dutch developers.
They didn't publish the sourcecode (yet) but you can download it from my own site. The aricle is in Dutch. You can find an (old) English version of this article here. An even more advanced implementation that also supports Drag & Drop can be found here.

READ MORE

All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.