Improve built-in ASP.NET Core DI container with Scrutor
ASP.NET Core has built-in dependency injection (DI) container. It’s easy and simple for the smaller project where you register all your dependencies (e.g. services, repositories, e.t.c.) by hand. Microsoft.Extensions.DependencyInjection has not built-in type scanning functionality, so if your project will grow, using it can be pretty hard. But you can resolve this problem by using Scrutor. Scrutor is an extension for built-in DI that allows you scan assembly and decorate services. In this article, we will look at scanning functionality.
ILSpy - IL code viewer plugin
Recently when I worked with ILSpy I wanted to see the Intermediate Language but I could not find this functionality. So I decided to create a plugin to ILSpy called ILViewer. You can find it on github: https://github.com/kmatyaszek/ILSpy-ILViewer.
C# 7: check null properly
If you develop application with C# 7 and you want to be sure that null is always check properly you should use constant pattern “null”. This is one of the 3 types of patterns in the new feature in C# called “pattern matching”. In this case, you don’t have to bother if in the class is defined override of the equals operator. In the following code snippets, we will go through two types of checking null (is and ==) and with or without override == operator.
JSON Web Token - exp, nbf, iat claims - convert DateTime to Unix time
In JWT following claims must be a number containing a date as a number:
exp
(Expiration Time) Claimnbf
(Not Before) Claimiat
(Issued At) Claim
Extended WPF Toolkit - PropertyGrid AdvancedOptionsMenu - copy button
In this post, I will show you how you can add copy button to WPF Toolkit PropertyGrid. To do this we are going to use AdvancedOptionsMenu
property. In the PropertyGrid
you should set ShowAdvancedOptions
to True
and add context menu to AdvancedOptionsMenu
:
DevExpress WPF Themes - how to disable DevExpress theming on native WPF controls
DevExpress Themes supports painting of the most standard native WPF controls. The more complex native WPF controls are not supported but you can find a corresponding alternative DevExpress control insted.
Quickly Launch Apps with Windows Key + R
In Windows operating system the run command window is the fastest way to access almost all Windows’ function. To open the run command window just press Windows Key + R. After that, you can enter a command to the Open textbox and press Enter. Below I gathered the most useful commands which you can use in daily basis work.
DevExpress WPF Themes - how to apply theme to an entire application
DevExpress theme manager has an important property ApplicationThemeName
. This property allows you to set global theme applied to the entire application. Without settings this property, you have to specify theme name on every new window in your project.
Visual Studio 2013 designer cache & disk space leak
I have recently encountered a problem with using VS2013 designer when I develop WPF application. Problem is with a designer cache which is not cleared out. After about three months I have ended up with 0 bytes on my C drive and I was not able to do anything. When I started searching for the possible cause of this situation I found information about the bug in VS2013 connected with the correctly delete cache data from disk. In my case, about 30GB of storage was being used by VS2013 designer cache.