private bool OverridesLayoutMethod (string name)
{
var method = GetType ().GetMethod (name, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
if (method == null)
return false;
if (!method.IsVirtual || !method.IsFamily)
return false;
if (method.ReturnType != typeof (Size))
return false;
if (UseNativeLayoutMethod (method.DeclaringType))
return false;
var parameters = method.GetParameters ();
if (parameters.Length != 1 || parameters [0].ParameterType != typeof (Size))
return false;
return true;
}