public static RemoteControl Register(GtkApplicationBase application) { BusG.Init(); var remoteControl = new RemoteControl(application); Bus.Session.Register(new ObjectPath(Path), remoteControl); if (Bus.Session.RequestName(Namespace) != RequestNameReply.PrimaryOwner) { return(null); } return(remoteControl); }
protected override bool IsRemoteInstanceRunning() { // Register Tasque RemoteControl try { remoteInstance = RemoteControl.Register(this); if (remoteInstance != null) { remoteInstance.RemoteInstanceKnocked = OnRemoteInstanceKnocked; Logger.Debug("Tasque remote control created."); } else { RemoteControl remote = null; try { remote = RemoteControl.GetInstance(); remote.KnockKnock(); } catch {} return(true); } } catch (Exception e) { Logger.Debug("Tasque remote control disabled (DBus exception): {0}", e.Message); } return(false); }