Blog

posts tagged with csharp

Silverlight projects in Visual Studio 2010

0 Comments
By Fons Sonnemans, 19-mei-2009

I finally found some time to test the beta of Visual Studio 2010. No problems found yet. It even supports a visual designer (Cider) for Silverlight projects. You can now use it to drag & drop controls from your toolbox, add rows/columns to a grid and set properties. Things which where only possible in Expression Blend.

Cider in Visual Studio 2010

READ MORE

Playing with Silverlight 3D Perspective

0 Comments
By Fons Sonnemans, 16-apr-2009

I have created a simple rotating clock using Silverlight 3.0. It uses Databinding, Animation and the new Projection property of UI Elements to apply 3D Transformations. You will have to install the Developer Runtime first before you can see it!

Download the sourcecode

Get Microsoft Silverlight

READ MORE

Favorite MIX09 Videos

0 Comments
By Fons Sonnemans, 31-mrt-2009

READ MORE

Silverlight 3.0 Beta

0 Comments
By Fons Sonnemans, 20-mrt-2009

The Silverlight 3.0 Beta is out. Tim Heuer has written a great blog with all the new features. I have added the new SaveFileDialog to my Sudoku.

Now I can start to write a new Silverlight 3 training!.

Update 20 july 2009: Implemented Silverlight 3.0 RTW and moved the game to http://www.silverarcade.com/games/sonnemaf/sudoku 

READ MORE

C# LINQ Pivot() Function

5 Comments
By Fons Sonnemans, 22-jan-2009

I have created a LINQ extension method which can be used to Pivot an enumeration. Just like you can PIVOT a SQL Query in SQL Server.

The following example uses the Pivot() function to group Employees by Department and Function and aggregates the Salary using a SUM. The second example uses a different grouping and Counts the number of employees per group.

  class Program {

    internalclass Employee {
        publicstring Name { get; set; }
        publicstring Department { get; set; }
        publicstring Function { get; set; }
        publicdecimal Salary { get; set; }
    }

    staticvoid Main(string[] args) {

        var l = new List<Employee>() {
            new Employee() { Name = "Fons", Department = "R&D", 
                Function = "Trainer", Salary = 2000 },
            new Employee() { Name = "Jim", Department = "R&D", 
                Function = "Trainer", Salary = 3000 },
            new Employee() { Name = "Ellen", Department = "Dev", 
                Function = "Developer", Salary = 4000 },
            new Employee() { Name = "Mike", Department = "Dev", 
                Function = "Consultant", Salary = 5000 },
            new Employee() { Name = "Jack", Department = "R&D", 
                Function = "Developer", Salary = 6000 },
            new Employee() { Name = "Demy", Department = "Dev", 
                Function = "Consultant", Salary = 2000 }};

        var result1 = l.Pivot(emp => emp.Department, 
            emp2 => emp2.Function, lst => lst.Sum(emp => emp.Salary));

        foreach (var row in result1) {
            Console.WriteLine(row.Key);
            foreach (var column in row.Value) {
                Console.WriteLine("  " + column.Key + 
                    "\t" + column.Value);

            }
        }

        Console.WriteLine("----");

        var result2 = l.Pivot(emp => emp.Function, 
            emp2 => emp2.Department, lst => lst.Count());

        foreach (var row in result2) {
            Console.WriteLine(row.Key);
            foreach (var column in row.Value) {
                Console.WriteLine("  " + column.Key + 
                    "\t" + column.Value);

            }
        }
        Console.WriteLine("----");
    }
}

The results in:

Tags: CSharp

READ MORE

Silverlight 2.0 Cross Domain Policy File Checker

0 Comments
By Fons Sonnemans, 18-dec-2008

In order to make Cross Domain calls in Silverlight 2 applications, the server you wish to download data from must have a Policy File in place that allows access to your site. I have created a Silverlight Application in which you can check the content of the Policy Files (if exists).

Click on the image below to try the application

Try application

READ MORE

Silverlight 2.0 Locator for Objectmap

0 Comments
By Fons Sonnemans, 10-nov-2008

I have created a new Silverlight 2 Control which is used in the Objectmap website. This control makes it easy for the customers of accounts to find their nearest object (branch, offices or sales outlet). They can also immediately retrieve dynamic directions to this location or link to a more info page.

Have a look at this demopage, sorry in Dutch only.

This control uses: Cross Domain WCF networking, Data Binding, Isolated Storage Settings, Google Maps API calls, Cross Domain HTML Bridge and Styling.

READ MORE

Hello World in Silverlight 2 using Visual Studio 2008 SP1 Video

0 Comments
By Fons Sonnemans, 09-okt-2008

Dit is mijn eerste Silverlight 2 instructie video. In deze video toon ik hoe je een eenvoudige Hello World applicatie kunt opzetten met behulp van Silverlight 2 (RC0) en Visual Studio 2008 met Service Pack 1.

Toon Video

Download de HelloWorld.zip sourcecode. Zorg er wel voor dat je alle benodigde software geinstalleerd hebt.

READ MORE

Silverlight 2.0 RollMenu

0 Comments
By Fons Sonnemans, 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

READ MORE

Hot Technologies Day

0 Comments
By Fons Sonnemans, 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.

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.