Reflection IT Blog

Benieuwd naar de laatste ontwikkelingen rondom software ontwikkeling en Reflection IT? Onze slimme koppen delen regelmatig hun kennis en ervaring. Zo weet jij wat er speelt!

Fons Sonnemans Blog posts

Silverlight 2.0 RollMenu

24-Jun-2008

I have created a RollMenu control in Silverlight 2 Beta 2. It uses an Xml file to configure the menu items.

Click on following image for a live demo.

Live Demo

Hot Technologies Day

18-Jun-2008

On June 17, I did two sessions on the Hot Technologies Day for Achmea (Interpolis) in Tilburg. I have given many trainings (C#, ASP.NET 2.0, AJAX, SQL2005, VS2008) at Achmea the last year. It is a very innovative company and very fun to work for.

This Hot Technologies Day was a mini seminar with 4 sessions: Silverlight 2, VSTS DB Pro, LINQ + Entity Framework, Microsoft Office SharePoint Server. Here is a picture of me taken during the Silverlight 2 session:

In the Silverlight 2 session I gave an overview of Silverlight 2 Beta 2. You can download the slide deck here.

In the LINQ + Entity Framework session I gave an overview of C# 3.0, LINQ, LINQ to SQL and Entity Framework. You can download the slide deck here.

Generic BidirectionalAssociationCollection

25-Mar-2008

Bidirectional associations are easy to design but difficult to program. You must write lot's of synchronization code with the risk of making mistakes. Have a look at the following example in which there is a bidirectional association between Employee (Employer) and Company (Employees).

The synchronization code is implemented in the AddEmployee(), RemoveEmployee() and the (Set)Employer methods.

Trace LINQ to SQL Queries

04-Dec-2007

ASP.NET Tracing is a powerful mechanism. LINQ to SQL doesn't support it out of the box. The DataContext class however has a Log property which can be set to a TextWriter object. This TextWriter object writes all SQL queries which are executed.

I have created a small class which derives from TextWriter to write all SQL queries to the System.Diagnostics.Trace class. I found out that I only had to override the WriteLine(string) and Write(string) methods.

The easiest way to assign a new TextToTraceWriter to the Log property of the DataContext object is by implementing the partial OnCreated() method in a partial class. See the following example in which also the Trace Category is set.

NotificationFormTraceListener Assembly

26-Nov-2007

During development, you can use the output methods of the Debug class to display messages in the Output window of the Visual Studio 2005 integrated development environment (IDE). For example:

' Visual Basic
Trace.WriteLine("Hello World!")
Debug.WriteLine("Hello World!")

// C#
Trace.WriteLine("Hello World!");
Debug.WriteLine("Hello World!");

Each of these examples will display "Hello World!" in the Output window when the application is run in the debugger.

The .NET TraceListners monitor trace and debug output. You use TraceListners to redirect this output to a specific medium. There are 3 TraceListners available: DefaultTraceListener, EventLogTraceListener and TextWriterTraceListener.

ConvertSelectedTextToAssociatedLabel Macro

09-Oct-2007

I have created a new Visual Studio 2005 Macro which can be used to convert a literal text to an asp:Label that is associated to the next control. You first have to select the text and then Run the ConvertSelectedTextToAssociatedLabel Macro. In the example below the text Age: is selected.

The result is an asp:Label with the correct Text and AssociatedControlID attributes.

Download Zipfile

My Code Snippets

02-Oct-2007

I use Visual Studio 2005 Code Snippets a lot. Especially during trainings. I have created some snippets myself which I want to share. Download this zipfile and extract it in the "My Documents\Visual Studio 2005\Code Snippets\Visual C#\My Code Snippets" folder.

ASP.NET ViewStateParameter

30-May-2007

I like the ASP.NET 2.0 DataSource controls. They are very flexible and easy to use. It has some great parameters like SessionParameter and ControlParameter. It doesn't have a ViewStateParameter. I have written it myself to fill this gap.

My First XNA Game

27-May-2007

I finally found some time to play with XNA. I learned a lot from Rob Miles at TechEd 2006. He has some great samples on his website. Rob will also be presenting about this subject on the DevDays 2007 in the Netherlands. Fun is guaranteed.

My first game is a remake of a game I build 20 years ago on my Commodore 64. You must move around a bouncing ball using your joystick. The ball may not collide with the flying birds. It took me only a few hours to build and it was great fun.

XNA - Drawing Text in XNA

Get in touch

Met dit formulier kunt u informatie over een In-Company of Small-Group training aanvragen. U kunt in het bericht aangeven welke training u wilt, voor hoeveel personen, wanneer deze verzorgd moet worden en op welke locatie. Wij nemen vervolgens contact met u op.

U kunt ons ook bereiken via telefoonnummer +31 (0)493-688810 of per mail training@reflectionit.nl.