Browse Source

Remove a bit more.

Bart De Smet 5 years ago
parent
commit
bab30aa8d6
1 changed files with 2 additions and 7 deletions
  1. 2 7
      Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs

+ 2 - 7
Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs

@@ -29,7 +29,7 @@ namespace System.Reactive
 
             if (target == null)
             {
-                e = targetType.GetEventEx(eventName, isStatic: true);
+                e = targetType.GetEvent(eventName, BindingFlags.Public | BindingFlags.Static);
                 if (e == null)
                 {
                     throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings_Linq.COULD_NOT_FIND_STATIC_EVENT, eventName, targetType.FullName));
@@ -37,7 +37,7 @@ namespace System.Reactive
             }
             else
             {
-                e = targetType.GetEventEx(eventName, isStatic: false);
+                e = targetType.GetEvent(eventName, BindingFlags.Public | BindingFlags.Instance);
                 if (e == null)
                 {
                     throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings_Linq.COULD_NOT_FIND_INSTANCE_EVENT, eventName, targetType.FullName));
@@ -111,11 +111,6 @@ namespace System.Reactive
             }
         }
 
-        public static EventInfo GetEventEx(this Type type, string name, bool isStatic)
-        {
-            return type.GetEvent(name, isStatic ? BindingFlags.Public | BindingFlags.Static : BindingFlags.Public | BindingFlags.Instance);
-        }
-
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
         public static MethodInfo GetMethod(this Type type, string name) => type.GetTypeInfo().GetDeclaredMethod(name);
 #endif