コード例 #1
0
        /// <summary>Creates a <see cref="NewReference"/> pointing to the same object</summary>
        public NewReference(BorrowedReference reference, bool canBeNull = false)
        {
            var address = canBeNull
                ? reference.DangerousGetAddressOrNull()
                : reference.DangerousGetAddress();

            Runtime.XIncref(address);
            this.pointer = address;
        }
コード例 #2
0
ファイル: NewReference.cs プロジェクト: filmor/pythonnet
        public NewReference(BorrowedReference reference, bool canBeNull = false)
        {
            var address = canBeNull
                ? reference.DangerousGetAddressOrNull()
                : reference.DangerousGetAddress();

#pragma warning disable CS0618 // Type or member is obsolete
            Runtime.XIncref(reference);
#pragma warning restore CS0618 // Type or member is obsolete
            this.pointer = address;
        }
コード例 #3
0
ファイル: managedtype.cs プロジェクト: AnandEmbold/pythonnet
 internal static bool IsInstanceOfManagedType(BorrowedReference ob)
     => IsInstanceOfManagedType(ob.DangerousGetAddressOrNull());