It takes your code, all of the code that will be touched by that try, sticks it in a code generator, compiles a dll, creates an exe, runs all of it in a seperate thread and then says... oops. It is the WORST way you could program. Simply put, don't use it, make sure you code doesn't break by using simple if statements for nullability at the very top of a method and get out instantly.
hi there, may I please have the permission to use your solution? I will share certain things with you, possibly offer you a position too. I have looked over what you have done and it is very insightful and it covers just about everything I need. There are still one or two more bits I need to add to it.
I built an encryption algorith, this will make it better, safer, faster, and even more secure. But it falls under the Microsoft license. I want nothing to do with Microsoft. They stole and are using my IP. That is why you are constantly getting updates. They cannot figure the whole thing out.
Your article is interesting but it is missing an important speech.
These is Framework native convertion already available which covert a part of this article.
You should definitely take a look at System.Convert
The method ChangeType in particular do a great job with low effort
thank you for commenting. You are right - ChangeType is a nice utility, as mentioned by other users like here and here. But as Microsoft points out in the docs you provided, this method is just a wrapper for IConvertible:
For the conversion to succeed, value must implement the IConvertible interface, because the method simply wraps a call to an appropriate IConvertible method.
IConvertible is described in my article. So describing the wrapper does not add any new value to the topic.
I have love for the TypeConverter framework. I wrote Deslang (on this site) which uses the type converter to build code that builds code (using the codedom), and i used that converter framework to convert parse tree nodes into CodeDom objects. Fun times.
Anyway, I'm rambling. It's a dark corner of .NET that I had fun with and I'm glad you've taken the time to explain it.
yes, I'm looking forward to do a rewrite for the net.standard 2.0 when it's out. Maybe I will provide a package for net.core if there is some time meanwhile. I will let you know.
Thank you for your interest!
As mentioned, the Universal Type Converter first tries to use the IConvertible interface for this. Because short implements IConvertible there is no need to go on to the implicit/explicit operator methods. It just uses IConvertible and returns.
Last Visit: 31-Dec-99 19:00 Last Update: 2-Mar-24 19:27