Base class for extensions whose instances *share* a single Python type object, such as the types that represent CLR methods, fields, etc. Instances implemented by this class do not support subtyping.
Inheritance: ManagedType
Esempio n. 1
0
        //====================================================================
        // MethodBinding dealloc implementation.
        //====================================================================

        public static new void tp_dealloc(IntPtr ob)
        {
            MethodBinding self = (MethodBinding)GetManagedObject(ob);

            Runtime.XDecref(self.target);
            Runtime.XDecref(self.targetType);
            ExtensionType.FinalizeObject(self);
        }
Esempio n. 2
0
        //====================================================================
        // ConstructorBinding dealloc implementation.
        //====================================================================

        public static new void tp_dealloc(IntPtr ob)
        {
            BoundContructor self = (BoundContructor)GetManagedObject(ob);

            Runtime.Decref(self.repr);
            Runtime.Decref(self.pyTypeHndl);
            ExtensionType.FinalizeObject(self);
        }
Esempio n. 3
0
        //====================================================================
        // ConstructorBinding dealloc implementation.
        //====================================================================

        public static new void tp_dealloc(IntPtr ob)
        {
            ConstructorBinding self = (ConstructorBinding)GetManagedObject(ob);

            Runtime.Decref(self.repr);
            Runtime.Decref(self.pyTypeHndl);
            ExtensionType.FinalizeObject(self);
        }
        //====================================================================
        // Descriptor dealloc implementation.
        //====================================================================

        public static new void tp_dealloc(IntPtr ob)
        {
            EventObject self = (EventObject)GetManagedObject(ob);

            if (self.unbound != null)
            {
                Runtime.Decref(self.unbound.pyHandle);
            }
            ExtensionType.FinalizeObject(self);
        }
Esempio n. 5
0
        /// <summary>
        /// Descriptor dealloc implementation.
        /// </summary>
        public new static void tp_dealloc(IntPtr ob)
        {
            var self = (MethodObject)GetManagedObject(ob);

            Runtime.XDecref(self.doc);
            if (self.unbound != null)
            {
                Runtime.XDecref(self.unbound.pyHandle);
            }
            ExtensionType.FinalizeObject(self);
        }
Esempio n. 6
0
        public new static int tp_setattro(IntPtr ob, IntPtr key, IntPtr val)
        {
            var managedKey = Runtime.GetManagedString(key);

            if ((settableAttributes.Contains(managedKey)) ||
                (ManagedType.GetManagedObject(val)?.GetType() == typeof(ModuleObject)))
            {
                var self = (ModuleObject)ManagedType.GetManagedObject(ob);
                return(Runtime.PyDict_SetItem(self.dict, key, val));
            }

            return(ExtensionType.tp_setattro(ob, key, val));
        }