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

How to emit signals with dbus-sharp? #43

Open
chmorgan opened this issue Aug 29, 2014 · 1 comment
Open

How to emit signals with dbus-sharp? #43

chmorgan opened this issue Aug 29, 2014 · 1 comment

Comments

@chmorgan
Copy link

I must be missing something, how would I emit a signal from dbus-sharp? I looked through the examples but don't see anything that looks analogous.

@chmorgan
Copy link
Author

And I'll answer my own question:

  • Add an event to your dbus object class, like:
public class Blah : MarshalByRefObject
{
    public event MyEventHandler OnEvent;

    public void EventHandler()
    {
        if(OnEvent != null) { OnEvent(); }
    }
}
  • Run 'dbus-monitor' to watch the dbus activity on your system
  • Call Blah's EventHandler() method and see that the 'OnEvent' signal was sent from your dbus object.

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