public static bool IsFinalizer(this IMethodInfo method) { return(string.Equals("Finalize", method.Name) && method.GetBaseDefinition().DeclaringType == typeof(object)); }