Note: This article is relevant only to Windows form applications. In .NET each control is composed of a canvas on which rendering is performed. To use the canvas of a control one needs to add an event handler to the Paint event. This article provides a couple of examples how to use the Paint event. … Continue reading Drawing on control canvas
Author: Karlston D'Emanuele
Cascade Assignment
Cascade assignment is the concept of having the same value assigned to different variables in one line. For example: copy1 = copy2 = copy3 = some_value; This article examines whether cascade assignment differentiate from having different assignment statements for each assignment operator. For the test scenarios consider the constructor of square shape where all sides … Continue reading Cascade Assignment
Accessing the correct Windows special folder
When developing Windows Applications it is quite common to end up having to access a special folder. Some examples of special folders are user Desktop, user Documents (My Documents in case of Windows XP), temporary folder, etc. When using the file system I/O functions it is important to always access the correct folder thus one … Continue reading Accessing the correct Windows special folder
Optional Parameters
When writing functions in C♯ sometimes one ends up putting parameters that might not be required all the time or when omitted would like to place a default value to these parameters. The way this is tackled is by using method overloads with different parameters. However, from the release of .NET 4.0 it is possible … Continue reading Optional Parameters
Named Parameters
Named parameters are a handy tool to deal with parameters especially for readability as each parameter value can be marked with the parameter tag. The concept of Named parameters has been in .NET from the first version; however they were used only with Attributes as part of the ECMA-334 specifications. In .NET 4.0 the concept … Continue reading Named Parameters