Posts Tagged ‘C#’

C# clipboard locking and a crash

Tuesday, January 1st, 2013

While testing a feature that accessed the clipboard recently, I came up against an interesting clipboard scenario. What test strategies and models can we use to approach this feature in order to highlight the most important risks?

Read more »

Binary serialization in C#

Saturday, March 5th, 2011

Serializing an object into a binary file is an easy and fast way to persist your objects. If binary serialization is used to cache objects normally read from an XML file, a database or some other file format, you’ll get even more benefits.

Read more »

Overload the array square bracket operator in C#

Thursday, November 13th, 2008

Although operator overloading is possible in C# (just like in C++), overloading the array square bracket operator is by definition not possible.  However, C# provides an alternative called indexers.  This is directly from the Microsoft C# Reference for the [] Operator:

Read more »

Why does an abstract class need to implement interface methods?

Sunday, September 28th, 2008

In a comment for a previous post (Top 10 differences between Java and C#), John P. Wood wrote:

As a (primarily) Java developer, I’ve also noticed that C# handles abstract classes that implement interfaces differently. In Java, an abstract class can implement an interface, and not provide implementations of all of the interface’s methods.  It is the responsibility of the first concrete class that has that abstract class as an ancestor to implement all of the methods in the interface.

Read more »

Portrait vs landscape, CRF design for a tablet PC

Thursday, August 14th, 2008

HP Tablet PC (convertible)How do you systematically make use of the varied Tablet PC screen resolution dimensions using C#?

Designing a CRF specifically for a Tablet PC can be a challenging experience, but it can also be one of the most rewarding.

The Tablet PC is very similar to a traditional desktop computer or a laptop.  As I write this entry, most Tablet PCs are running some variant of Windows.  Whether it’s Windows XP Tablet PC Edition or Vista (which has built-in support for Tablet PC specific functionality), you’re basically dealing with a Windows machine and you can pretty much treat it as such…  almost.

Read more »

Quick and dirty “dirty checking” for Windows form, C#

Wednesday, July 30th, 2008

While designing a CRF, little short-cuts can save you lots and lots of time.  This time-saver is straight-forward code-wise and should fit right into your C# code without much modification.

During CRF design time, I often have CRFs that have dozens and dozens of input controls (radio buttons, dropdowns, listboxes, textboxes…).  I’d like to add OnChange handlers to all of these input controls so that I know when a change has been made. Basically, what it comes down to is I want to know when the form is dirty, but I don’t want to add all the handlers by hand.  Fortunately, I didn’t have to and neither do you!

Read more »

Top 10 differences between Java and C#

Wednesday, April 2nd, 2008

My latest transition from Java to C# left me scratching my head and scrambling to find the differences.  Don’t get me wrong — they are very similar, but some key syntax and philosophical differences set these two languages apart.  Below are my top 10 differences that I wish someone told me before I pulled out yet more hair.

Read more »