Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

How to catch signals? #56

Open
dicktracy87 opened this issue May 20, 2016 · 0 comments
Open

How to catch signals? #56

dicktracy87 opened this issue May 20, 2016 · 0 comments

Comments

@dicktracy87
Copy link

dicktracy87 commented May 20, 2016

I'm playing with the Notifications example, I would like to print something on the console output when a notification is closed. So I added the event to the interface

    [Interface ("org.freedesktop.Notifications")]
    public interface Notifications : Introspectable, Properties
    {
        ServerInformation GetServerInformation ();
        string[] GetCapabilities ();
        void CloseNotification (uint id);
        uint Notify (string app_name, uint id, string icon, string summary, string body, string[] actions, IDictionary<string,object> hints, int timeout);
        event NotificationClosedHandler NotificationClosed;
        event ActionInvokedHandler ActionInvoked;
    }
    public delegate void NotificationClosedHandler (uint id, uint reason);
    public delegate void ActionInvokedHandler (uint id, string action);

And the delegate in the main:

    nf.NotificationClosed += delegate(uint id, uint reason) {
        Console.WriteLine("Notification Closed");
    };

The code compiles without errors but I nothing is printed when a notifications is closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant