From 8c4e0f12030235192d46676d7c30afd1721412a5 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 30 Nov 2014 14:04:00 +0000 Subject: [PATCH] Move some extension methods to a better location --- BizHawk.Common/Extensions/ReflectionExtensions.cs | 11 +++++++++++ BizHawk.Emulation.Common/Extensions.cs | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/BizHawk.Common/Extensions/ReflectionExtensions.cs b/BizHawk.Common/Extensions/ReflectionExtensions.cs index b2306ac221..5b1179cf0c 100644 --- a/BizHawk.Common/Extensions/ReflectionExtensions.cs +++ b/BizHawk.Common/Extensions/ReflectionExtensions.cs @@ -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); + } } } diff --git a/BizHawk.Emulation.Common/Extensions.cs b/BizHawk.Emulation.Common/Extensions.cs index cebec05246..b84b23e31f 100644 --- a/BizHawk.Emulation.Common/Extensions.cs +++ b/BizHawk.Emulation.Common/Extensions.cs @@ -22,18 +22,6 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions return !info.GetCustomAttributes(false).OfType().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().Any();