Writing

C#

What the C# compiler generates behind the scenes, plus practical C# techniques for Windows and WPF applications.

  1. The object header gets complicated

    The CLR object header bit by bit: thin locks, sync block indexes, hash codes, and the difference between thin and fat locks.

  2. C# behind the scenes

    The introduction to a series on the code the C# compiler generates for language features such as yield and local functions.

  3. C# behind the scenes: Local functions

    How the C# compiler turns local functions into ordinary methods, and how captured variables move into a generated display struct.

  4. C# behind the scenes: yield

    How the C# compiler turns an iterator method that uses yield return into a generated state machine class.

  5. A low-level global keyboard hook in C#

    A reusable C# class for global low-level keyboard hooks with SetWindowsHookEx, and how to register and remove key combinations.

  6. Localization with ResourceManager

    A localization design for .NET applications built on .resx files and ResourceManager, with one access point that can validate and log missing values.

  7. Showing help for the focused WPF control with F1

    Showing context help for the focused WPF control when the user presses F1, using a CommandBinding and an attached property while staying within MVVM.