What is the simplest way of testing if an object implements a given interface in C#? (Answer to this question in Java)
In addition to testing using the "is" operator, you can decorate your methods to make sure that variables passed to it implement a particular interface, like so:
public static void BubbleSort(ref IList unsorted_list) where T : IComparable
{
//Some bubbly sorting
}
I'm not sure which version of .Net this was implemented in so it may not work in your version.