Python.Runtime.DelegateObject.tp_call C# (CSharp) Method

tp_call() public static method

public static tp_call ( IntPtr ob, IntPtr args, IntPtr kw ) : IntPtr
ob System.IntPtr
args System.IntPtr
kw System.IntPtr
return System.IntPtr
        public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw)
        {
            // todo: add fast type check!
            IntPtr pytype = Runtime.PyObject_TYPE(ob);
            DelegateObject self = (DelegateObject)GetManagedObject(pytype);
            CLRObject o = GetManagedObject(ob) as CLRObject;

            if (o == null)
            {
                return Exceptions.RaiseTypeError("invalid argument");
            }

            Delegate d = o.inst as Delegate;

            if (d == null)
            {
                return Exceptions.RaiseTypeError("invalid argument");
            }
            return self.binder.Invoke(ob, args, kw);
        }