When sending notifications in a WinForms app, a MessageBox is the only way to go… or is it? Let’s get creative and see what else we might do.
Writing async code whenever possible is great, but how do we do it when we’re stuck with legacy (and very synchronous) code?
It’s trivial to register a dependency in a .NET API, but it’s important to clarify a few terms that drastically change a dependency’s lifetime.
We can deconstruct tuples in C#, but does it work with other types? And assuming it does (spoiler - it does), is it worth bothering with?
What is Generic Math support in C# 11, and how do we take advantage of it? Let’s dig in and find out! (part 3 of 3)
What’s it mean to overload operators in C#? And what’s that have to do with Generic Math in C# 11? Let’s find out! (part 2 of 3)
What are static abstract members (new in C# 11), what can we do with them, and how are they related to Generic Math? (part 1 of 3)
A big challenge with any language is trying to group and organize things sensibly, and returning multiple values is no exception. Let’s check out Tuples and deconstruction, and see how they can help us out.
Sometimes the safer way to “update” old code is to leave it be and paint over it with a newer construct. Let’s see how to modernize a BackgroundWorker using Tasks and TaskCompletionSource.
Named arguments in C#.. they’ve been around a long time, but does anyone use them? Let’s check out another feature that helps tame wild code.
C# 7 introduced a new tool for the belt - local functions. Let’s take a look at what they are, how to use them, and why we might not want to.
Checking for nulls in C# is tedious, but C# 6 gave us the null-conditional operator. Let’s see what we can do with it!
The longer I write software, the more I come to appreciate clear code. String interpolation in C# is just one more way to help us do that.
Thanks to CEFSharp, we can finally bring WinForms to the web! That didn’t sound right. Okay, let’s just look at hosting a site in IIS and showing it.
WinForms and the web. Like oil and water, they don’t mix well. But with CEFSharp, they mix a LOT better. Let’s check it out.
Unit testing a WinForms app is an uphill battle in the best of times, before you add in classes like MessageBox. Let’s make the best of it.
There’s a lot of ways to make our code work for us. Let’s check out using the nameof operator to avoid magic strings.
If you’re in a legacy codebase with a centralized “message box” form, why not add some features that make it work for you? 😏
If you find yourself supporting a WinForms application, you’re likely to notice the tests… or lack thereof. Just because we may not have been so focused on automated tests and continuous integration when WinForms was younger, that doesn’t mean we can’t introduce them now. Better late than never!
Using the async/await pattern in WinForms is an easy win, helping prevent one of the most annoying user experiences - a frozen UI.