New to Creator’s Update, we can now specify a static function in charge of creation instance from string through a very well named attribute CreateFromString.
Month: February 2017
ReadLine comes to .Net (Core and full)
ReadLine is a GNU Readline like library built in pure C#. It can serve as a drop in replacement for the inbuilt
Console.ReadLine()
and brings along with it some of the terminal goodness you get from unix shells, like command history navigation and tab auto completion.
An AutoCompletionHandler callback can be used to provide an array of suggestion.
tsolarin/readline: A GNU-Readline like library for .NET/.NET Core
How to disable hardware rendering for a WPF process
Apparently, my customers do not have the WPF black screen bug (Video Rendering Issues for WPF Windows – Rick Strahl’s Web Log) but the solution is elegant enough to be noted.
With some video card/drivers, WPF’s main window (and more particularilly MahApps main window) can be completly black. This seems to be an hardware rendering problem. Good news, a per processs solution exist:
System.Windows.InteropRenderOptions.ProcessRenderMode
that can be set at startup to SoftwareOnly. Good to know!
Hosting .Net core from native code
Use of COM based
ICLRRuntimeHost Interface
to host .Net Core from native C++ code How the dotnet CLI tooling runs your code · Performance is a Feature!.
Topic already covered in Hosting .NET Core CLR in Windows native process.
Impacts of new() contraint in C#
“Disecting the new() constraint” is very instructive: new() constraint has a big performance impact and we must know its implementation to understand why ctor exceptions are wrapped to a TargetInvocationException.
By the way, in same blog post, I’ve discovered that some well known static functions can be custom replaceable. It means you can locally redefined them. System.Activator.CreateInstance<T> is replaced by a faster one.
Beware, this is a completly not documented behavior than can be theoretically remove any time. Just to mitigate previous remark, this undocumented behavior is so important survived the Roslyn transition.
ExceptionDispatchInfo
Starting from .Net 4.5 (but I was not aware):
Starting from .NET 4.5 you can use ExceptionDispatchInfo class to rethrow an arbitrary exception object (an inner exception in this case) without altering the exception’s stack trace
Element-ui
Yet another Vue.js UI library: Element-ui. Many customization available and detailled in doc.
Quasar Framework
A Vue.js framework for building browser, hybrid and Electron SPA apps: Quasar Framework.
VUETIFY.JS
Found on Vue.js repository, VUETIFY.JS is a portage freely inspired by material design.
It’s impressive ! Vue.js 2 Component Framework | Vuetify.js.