Tag Archives: c#

Mono.Cecil – Generics

Till now we saw an overview on Cecil and two simple examples. Today I want to show how you can handle generics in Cecil. For the example I’m going to use EqualityComparer<>

Posted in .NET, c# | Tagged , , , | Leave a comment

Value type methods – call, callvirt, constrained and hidden boxing

Long time ago I wrote a post here on  call vs callvirt and the needed of the this null check. Here I want to wrote about this topic but on value types. Look on these three ToString() calls:

Posted in .NET, c#, Roslyn | Tagged , , , , , , , | Leave a comment

Make method static with Roslyn

Before Roslyn days, this was not easy to do that, like others re factoring. Fortunately we have R# for this. But now it’s not so hard to re factor an instance method into static method. I wrote a rewriter that … Continue reading

Posted in .NET, c#, Roslyn | Tagged , , , , , | Leave a comment

Convert linq query syntax to fluent syntax

In c# you can write LINQ queries in two ways. One is the fluent invocation syntax (extension method) and the other is query comprehension syntax. Fluent example: Comprehension example: I was needed the ability to take the comprehension syntax and … Continue reading

Posted in .NET, c#, Roslyn | Tagged , , , , , , | Leave a comment

Low-Level Global Keyboard Hook in C#

I had to implement a mechanism for a global low-level keyboard hook. After a brief search on the internet I understood the principle and I went out with solution in hand. First I show you how to use it, it’s very simple. To register … Continue reading

Posted in .NET | Tagged , , , , , , , , | Leave a comment

Localization using ResourceManager

Multiple language support is a very important thing to think of it in early software development process to avoid unnecessary work later on when we realize that we need it. So how is it done? There are several ways to support … Continue reading

Posted in .NET, c#, WPF | Tagged , , | Leave a comment