IT Blog NOW

An Information Technology View by Sam Moreira

Entries Tagged ‘C#’

How To Use Custom Objects as Hashtable Keys Without Getting Duplicated Keys in Your Collection

Have you ever faced an issue of having duplicated key objects in your Hashtable even though the objects represent the same entity? In this post I’ll show a way to circumvent the Hashtable behavior.
Sometimes we have a need to use objects as Hashtable keys instead of strings. At least for me, most of the time, [...]

How to Monitor File System Changes in C#

Have you ever needed to monitor a specific directory or file for changes? .Net Framework has a class called FileSystemWatcher within System.IO namespace that allows developers to take action when a specific event occurs in the File System. In this posting, I’ll show you how you can use the FileSystemWatcher class to monitor your files [...]

How to Implement Automated Properties in C#

C# 3.0 and later versions give developers the ability to have underlying property structures automatically taken care by the compiler, which behind the scenes, creates the private members and implements the get and set inner workings. In this posting, I’ll cover how to create regular and automated properties in C#.
Before automated properties became available, the [...]