Move some extension methods to a better location

This commit is contained in:
adelikat 2014-11-30 14:04:00 +00:00
parent 92243cd393
commit 8c4e0f1203
2 changed files with 11 additions and 12 deletions

View File

@ -206,5 +206,16 @@ namespace BizHawk.Common.ReflectionExtensions
return (IntPtr)dyn.Invoke(null, new object[] { new object() });
}
public static bool ThrowsError(this MethodInfo info)
{
var il = info.GetMethodBody().GetILAsByteArray();
return (il[il.Length - 1] == 0x7A);
}
public static bool IsEmpty(this MethodInfo info)
{
var il = info.GetMethodBody().GetILAsByteArray();
return (il.Length == 1 && il[0] == 0x2A);
}
}
}

View File

@ -22,18 +22,6 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
return !info.GetCustomAttributes(false).OfType<FeatureNotImplemented>().Any();
}
public static bool ThrowsError(this MethodInfo info)
{
var il = info.GetMethodBody().GetILAsByteArray();
return (il[il.Length - 1] == 0x7A);
}
public static bool IsEmpty(this MethodInfo info)
{
var il = info.GetMethodBody().GetILAsByteArray();
return (il.Length == 1 && il[0] == 0x2A);
}
public static bool IsImplemented(this PropertyInfo info)
{
return !info.GetCustomAttributes(false).OfType<FeatureNotImplemented>().Any();