public static void CheckForInterface(Type type, Type interfaceType)
{
if (type == null || interfaceType == null) return;
if (Array.IndexOf<Type>(type.GetInterfaces(), interfaceType) == -1)
throw new System.Configuration.ConfigurationErrorsException("The type " + type.AssemblyQualifiedName + " must implement " + interfaceType.AssemblyQualifiedName);
}