Many objects in .NET are stored in a hierarchy. For example: controls, files and folders, and anything you would normally display in a tree view. There are many different algorithms for finding the root of a hierarchy. Here is one of them:
Mono is an open source implementation of the .NET framework for Linux, Windows, MacOS and other operating systems. Mono v2.0 was just released and represents a major milestone in the Mono project.
Microsoft announced the next version of its developer platform, which will be named Visual Studio 2010 and .NET Framework 4.0. Microsoft said VS10 will focus on five key areas (in marketing-speak): riding the next-generation platform wave, inspiring developer delight, powering breakthrough departmental applications, enabling emerging trends such as cloud computing, and democratizing application life-cycle management (ALM).
Computerworld has published an in-depth interview with Microsoft’s leader of C# development, Anders Hejlsberg. A prominent Danish software engineer, Hejlsberg also wrote Turbo Pascal and was lead architect of the team that developed Delphi. Hejlsberg shared with Computerworld his thoughts on the development of C#, future programming trends, and his experiences putting out fires. Here is a brief excerpt:
It’s easy to determine if your C# application is 64-bit. Just check the Size property of IntPtr. If it’s 8, then your application is 64-bit. If it’s 4, then your application is 32-bit.
Here is a simple C# console program to demonstrate this:
The DataGridView is a powerful grid control included in the .NET Framework. One function missing, however, is the ability to hide the current selection when the DataGridView control is not focused. What the DataGridView class needs is a HideSelection property, similar to the ListView and TextBox. But the .NET designers have not included this capability in the DataGridView class.
The order of C# switch case statements in your code has no effect on performance.
Microsoft has released Service Pack 1 for Visual Studio 2008 and .NET 3.5. This update patches numerous bugs, improves performance, and even adds a few new features.
As a .NET commercial software developer, I am most excited that SP1 provides a .NET Framework installation optimized for client applications. The optimized download is less than 28 MB, compared to the original 200 MB download that all but ensured consumers would not download .NET 3.5 and hence forced us to remain on .NET 2.0 (see FAT .NET).
How do you sort a C# array in descending or reverse order? A simple way is to sort the array in ascending order, then reverse it:
It’s not a trivial exercise to validate a file path on a Windows PC. There are a few special cases depending on the file system and operating subsystem: