Yesterday, I have posted one tip which discusses how you could use ReaderWriterLock to implement shared locking on items that does require concurrent access. Today I will use SpinLock to do the same. SpinLock like Monitor spins a number of CPU cycles when it tries to acquire a lock. Monitor on the other hand Spins […]
Thread shutdown is a mechanism to stop a worker Thread that is already running in parallel. That means either to stop an already running thread using Thread.Abort or shutting down the Thread normally using the user defined code.
Writing a stretchable content container is very easy in WPF. The ViewBox allows you to write stretchable container which will shrink / expand according to the size of the content. In this post I will build a simple Stretchable ContentControl which will expand itself as you go on adding controls to it.
If you are trying to run a WPF application, you must remember that WPF content is actually constraint to a single HWND. You could have only a single window handle that represents the entire window, and everything inside it is a bitmap drawn on the WPF canvas. Except Popup (which eventually have its own HWND) […]
If you have worked with WPF 3.5 before, you know that declaring a normal image in your code will render your image quite fine. But If you do the same thing in .NET 4.0 or even you convert your existing application from previous version to .NET 4.0, all the images that were rendering quite Ok […]
It is interesting that Nulls actually follows object hierarchy. That means the object of a class which is the most derived is taken to be more nullable than its base.
During Development of the application/product or after deployment of the application/product there might be a situation where you want to find out the the how much time is taken by you code to execute ? Is it too much slow ? Answer to this problem is make use of StopWatch class of System.Diagnostics namespace which […]
SortedSet is one class that is been added to the .Net class library 4.0 which actually merges the behaviour of HashSet and SortedList together. It maintains the sorted ordering of the list without affecting performance.
The Visual Studio IDE Output window displays status messages for various features with in IDE include build errors, compilation error, Project configuration information, that occur when a project is compiled. This window is very much important to see what your application doing during build. Now, this windows is by default turn off. So when ever […]
Fixed is the one of uncommon keyword in C#. The keyword is Fixed which can only be used in Unsafe C# code blocks. Fixed statement sets the pointer to be in a fixed memory address so that, it will not be moved to anywhere even if Garbage Collection Thread is invoked.
If you think only .NET languages are the only thing that is getting evolved day by day while SQL Syntaxes remains constant, you might have to think it again. SQL Server is gradually coming with evolution day by day with some alternative syntaxes of writing SQL Statements to make more complex SQL statements easier to […]
In Visual Studio you can enable and disabled the automatic #region code surround while implement interface. Well by default it’s set to off and which is mostly like by all developer. But if you want some change, and you want while implementing interface it should automatically surround by #region then you have to go to […]