static void OverrideMessage(GLib.GType gtype, MessageNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("message")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalMessage(Gst.Message message) { MessageNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("message")); unmanaged = (MessageNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(MessageNativeDelegate)); } if (unmanaged == null) { return; } unmanaged(this.Handle, message == null ? IntPtr.Zero : message.Handle); }