Turn every Class into a Singleton!   Recently updated !

You can design any C# Class as a Singleton Class. By doing so you can not use it any other way. Or you can design your Classes as Standard Classes and turn them with this Class into a Singleton: 1234567891011121314internal static class Singleton<T>         where T : […]

Visual Studio 2015

Visual Studio 2015

C# version 7.0 features

C# 7.0 is the seventh version of C# that has build up on since 2015. This version contains some new features: language support for Tuples, local functions, out var declarations, digit separators, binary literals, pattern matching, throw expressions, ref return and ref local and extended expression bodied members list.

Auto History Extension for Visual Studio

How Generics in C# help to Improve Performance

First of all, generics improve the developer performance.    🙂 With generics you don’t have to use casting so you reduce the execution-time type checking. Compile-time type checking is always better! Another performance improvement is in terms of speed and memory consumption, because the JIT can treat value types in a […]

Check if a given Font is installed on Windows Desktop in C# 1

Is there an easy way in .NET to test if a Font is installed on the current machine? Oh, there are (like almost allways) several ways…  🙂 12345678910private bool IsFontInstalled(string fontName) { using (var testFont = new Font(fontName, 8)) { return 0 == string.Compare( fontName, testFont.Name, StringComparison.InvariantCultureIgnoreCase); } } …but […]

VS 2013

Exception handling – the common mistake

C# programmers usually forget that when they throw an exception using „throw ex” they loose the stack trace. It is then considerably harder to debug an application and to achieve appropriate log messages. When simply using „throw” no data is lost and the whole exception together with the stack trace […]