void display_NotificationCallback(Growl.CoreLibrary.NotificationCallbackEventArgs args) { if (args.NotificationUUID != null && this.notificationsAwaitingCallback.ContainsKey(args.NotificationUUID)) { Growl.Daemon.CallbackInfo cbInfo = this.notificationsAwaitingCallback[args.NotificationUUID]; this.notificationsAwaitingCallback.Remove(args.NotificationUUID); if (this.NotificationCallback != null) { if (cbInfo != null) { cbInfo.SetAdditionalInfo(args.CustomInfo); } this.NotificationCallback(cbInfo, args.Result); } } }
Response server_NotifyReceived(Notification notification, Growl.Daemon.CallbackInfo callbackInfo, Growl.Connector.RequestInfo requestInfo) { Response response = new Response(); if (callbackInfo != null) { if (callbackInfo.ShouldKeepConnectionOpen()) { response.SetCallbackData(notification.ID, callbackInfo.Context, Growl.CoreLibrary.CallbackResult.CLICK); // simulate a wait System.Threading.Thread.Sleep(5000); } else { string url = callbackInfo.Context.CallbackUrl; server_ServerMessage(null, Growl.Daemon.GrowlServer.LogMessageType.Information, url); } } //Console.WriteLine("notification response"); return(response); }
public override void ProcessNotification(Growl.DisplayStyle.Notification notification, Growl.Daemon.CallbackInfo cbInfo, Growl.Connector.RequestInfo requestInfo) { this.realDisplay.ProcessNotification(notification, cbInfo, requestInfo); }
public virtual void ProcessNotification(DisplayStyle.Notification notification, Growl.Daemon.CallbackInfo cbInfo, Growl.Connector.RequestInfo requestInfo) { try { bool done = this.display.ProcessNotification(notification, this.ActualName); // for any notifications that remain open (essentially, any visual notifications), add them to a list so we // can handle their callbacks later if (!done) { this.notificationsAwaitingCallback.Add(notification.UUID, cbInfo); } } catch (Exception ex) { // suppress any exceptions here (in case the display fails for some reason) Utility.WriteDebugInfo(String.Format("Display failed to process notification: '{0}' - {1}", ex.Message, ex.StackTrace)); } }
internal abstract void ForwardNotification(Growl.Connector.Notification notification, Growl.Daemon.CallbackInfo callbackInfo, Growl.Daemon.RequestInfo requestInfo, bool isIdle, Forwarder.ForwardedNotificationCallbackHandler callbackFunction);