Visual Studio 2015

Turn every Class into a Singleton!

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 : […]

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.

Visual Studio 2015

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 […]

Auto History Extension for Visual Studio

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

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 […]