One problem with files is that testing can be problematic, what file to use? what path to use? how to test when a file is missing? do I really need another file in my Version Control System? how to simulate 100s of files in one directory? Sometimes it can be useful to Mock these files, […]
In this example I created a Worker class that simply does some work. The class sends a Workstarted event right at the beginning of the work task and a closing WorkCompleted event at the end. The WorkStarted event has the standard EventHandler delegate and the WorkCompleted event has an EventHandler<int> delegate (with generic type int) […]
It is possible to create professional Looking PDF written in Markdown with Pandoc. I feel that writing in Markdown is really intuitive for developpers, it is just you with your favorite text Editor (Notepad++ for example), no overwhelming GUI, no formatting, no distractions, just you and your content (if you want to push the no […]
Executing path I sometimes want to get the path of the .exe file that is currently running, usually because I put some folders for logging or configuration there, this is a way to get this path: https://stackoverflow.com/questions/3991933/get-path-for-my-exe Special folders Here is a list of all C# Environment.SpecialFolder:
Constructor https://docs.microsoft.com/en-us/dotnet/api/system.datetime.-ctor?view=netcore-3.1 ToString() method In this example I use DateTime.Now.ToString(“yyyyMMdd_HHmmss”) in order to create a dated file Name that will look like this: 20200610091524_myText.txt https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
Console vs. GUI GUIs are nice and pretty but clicking around is just not what we developpers do… They also bring quite daunting disadvantages: relatively slow cannot be controlled / run in the background painful to automate As a developper there will come a time where for testing a new cool feature you are going […]
Sections of your program version Software Version is actually an interesting topic, the norm in dotNet seems to be: Major.Minor.Build.Revision with different opinions on what Build and Revision are. Microsoft sees Build as a recompilation of the same source but with different processor, platform or compiler change (see https://docs.microsoft.com/en-us/dotnet/api/system.version?view=netframework-4.8), which is a bit confusing because […]
Logging is an absolute must-have feature, which is too convenient and easy to not do it. When I start a new project it is something I will pretty much do on the first days because it brings immediate advantages: for debugging for commenting / understanding code you have an actual document to discuss over with […]
Multithreading becomes absolutely necessary as soon as you start working with GUI. You cannot let the system freeze and your users asking themselves if the program crashed each time you let a long operation run, that is why you should call async methods. An async method has to declare await in order to free the […]
Something went wrong. Please refresh the page and/or try again.
Follow My Blog
Get new content delivered directly to your inbox.