();
-
- while (type != null)
- {
- MethodInfo[] methods = type.GetMethods(flags);
- foreach (MethodInfo method in methods)
- {
- if (!addedMethods.Contains(method.Name))
- {
- object[] attrs = method.GetCustomAttributes(marker, false);
- if (attrs.Length > 0)
- {
- string method_name = method.Name;
- var mi = new MethodInfo[1];
- mi[0] = method;
- MethodObject m = new TypeMethod(type, method_name, mi);
- Runtime.PyDict_SetItemString(typeDict, method_name, m.ObjectReference);
- m.DecrRefCount();
- addedMethods.Add(method_name);
- }
- }
- }
- type = type.BaseType;
- }
- }
-
-
///
/// Utility method to copy slots from a given type to another type.
///
diff --git a/src/runtime/typemethod.cs b/src/runtime/typemethod.cs
deleted file mode 100644
index 4da92613c..000000000
--- a/src/runtime/typemethod.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace Python.Runtime
-{
- ///
- /// Implements a Python type that provides access to CLR object methods.
- ///
- internal class TypeMethod : MethodObject
- {
- public TypeMethod(Type type, string name, MethodInfo[] info) :
- base(type, name, info)
- {
- }
-
- public TypeMethod(Type type, string name, MethodInfo[] info, bool allow_threads) :
- base(type, name, info, allow_threads)
- {
- }
-
- public override IntPtr Invoke(IntPtr ob, IntPtr args, IntPtr kw)
- {
- MethodInfo mi = info[0];
- var arglist = new object[3];
- arglist[0] = ob;
- arglist[1] = args;
- arglist[2] = kw;
-
- try
- {
- object inst = null;
- if (ob != IntPtr.Zero)
- {
- inst = GetManagedObject(ob);
- }
- return (IntPtr)mi.Invoke(inst, BindingFlags.Default, null, arglist, null);
- }
- catch (Exception e)
- {
- Exceptions.SetError(e);
- return IntPtr.Zero;
- }
- }
- }
-}
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy