static void OverrideRun(GLib.GType gtype, RunNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("run"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Exemplo n.º 2
0
        private bool InternalRun(GLib.SocketConnection connection, GLib.Object source_object)
        {
            RunNativeDelegate unmanaged = class_abi.BaseOverride <RunNativeDelegate>(this.LookupGType(), "run");

            if (unmanaged == null)
            {
                return(false);
            }

            bool __result = unmanaged(this.Handle, connection == null ? IntPtr.Zero : connection.Handle, source_object == null ? IntPtr.Zero : source_object.Handle);

            return(__result);
        }
        private bool InternalRun(GLib.SocketConnection connection, GLib.Object source_object)
        {
            RunNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("run"));
                unmanaged = (RunNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(RunNativeDelegate));
            }
            if (unmanaged == null)
            {
                return(false);
            }

            bool __result = unmanaged(this.Handle, connection == null ? IntPtr.Zero : connection.Handle, source_object == null ? IntPtr.Zero : source_object.Handle);

            return(__result);
        }
Exemplo n.º 4
0
		static void OverrideRun (GLib.GType gtype, RunNativeDelegate callback)
		{
			GThreadedSocketServiceClass class_iface = GetClassStruct (gtype, false);
			class_iface.Run = callback;
			OverrideClassStruct (gtype, class_iface);
		}