Exemple #1
0
 static void OverrideHandshake(GLib.GType gtype, HandshakeNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("handshake"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemple #2
0
        private bool InternalHandshake(GLib.Cancellable cancellable)
        {
            HandshakeNativeDelegate unmanaged = class_abi.BaseOverride <HandshakeNativeDelegate>(this.LookupGType(), "handshake");

            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr error    = IntPtr.Zero;
            bool   __result = unmanaged(this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            return(__result);
        }
        private bool InternalHandshake(GLib.Cancellable cancellable)
        {
            HandshakeNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("handshake"));
                unmanaged = (HandshakeNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(HandshakeNativeDelegate));
            }
            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr error    = IntPtr.Zero;
            bool   __result = unmanaged(this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            return(__result);
        }
Exemple #4
0
		static void OverrideHandshake (GLib.GType gtype, HandshakeNativeDelegate callback)
		{
			GTlsConnectionClass class_iface = GetClassStruct (gtype, false);
			class_iface.Handshake = callback;
			OverrideClassStruct (gtype, class_iface);
		}