public void SendNotification(string id, GLib.Notification notification)
        {
            IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup(id);

            g_notification_backend_send_notification(Handle, native_id, notification == null ? IntPtr.Zero : notification.Handle);
            GLib.Marshaller.Free(native_id);
        }
Exemple #2
0
        private void InternalSendNotification(string id, GLib.Notification notification)
        {
            SendNotificationNativeDelegate unmanaged = class_abi.BaseOverride <SendNotificationNativeDelegate>(this.LookupGType(), "send_notification");

            if (unmanaged == null)
            {
                return;
            }

            IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup(id);

            unmanaged(this.Handle, native_id, notification == null ? IntPtr.Zero : notification.Handle);
            GLib.Marshaller.Free(native_id);
        }
        private void InternalSendNotification(string id, GLib.Notification notification)
        {
            SendNotificationNativeDelegate unmanaged = null;

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

            IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup(id);

            unmanaged(this.Handle, native_id, notification == null ? IntPtr.Zero : notification.Handle);
            GLib.Marshaller.Free(native_id);
        }
 protected virtual void OnSendNotification(string id, GLib.Notification notification)
 {
     InternalSendNotification(id, notification);
 }