コード例 #1
0
ファイル: Form1.cs プロジェクト: SheffieldUni/growl-uos
        Response server_RegisterReceived(Growl.Connector.Application application, List <NotificationType> notificationTypes, Growl.Connector.RequestInfo requestInfo)

        {
            if (requestInfo.PreviousReceivedHeaders.Count < 0)  // change to a positive number to forward

            {
                Forwarder fwd = new Forwarder(password, "127.0.0.1", Growl.Connector.GrowlConnector.TCP_PORT, requestInfo);

                fwd.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.AES;

                fwd.Register(application, notificationTypes.ToArray());
            }



            Response response = new Response();

            return(response);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: SheffieldUni/growl-uos
        Growl.Daemon.SubscriptionResponse server_SubscribeReceived(Growl.Daemon.Subscriber subscriber, Growl.Connector.RequestInfo requestInfo)

        {
            Growl.Daemon.SubscriptionResponse r = new Growl.Daemon.SubscriptionResponse(300);

            return(r);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: SheffieldUni/growl-uos
        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);
        }
コード例 #4
0
 public override void ForwardNotification( Notification notification, CallbackContext callbackContext, RequestInfo requestInfo, bool isIdle, ForwardedNotificationCallbackHandler callbackFunction )
 {
     //notify.ShowBalloonTip ( 4000, notification.Title, notification.Text, ToolTipIcon.Info );
 }
コード例 #5
0
 public override void ForwardRegistration( Connector.Application application, List<NotificationType> notificationTypes, RequestInfo requestInfo, bool isIdle )
 {
     // do nothing
 }
コード例 #6
0
        public override void ForwardNotification(Growl.Connector.Notification notification, Growl.Connector.CallbackContext callbackContext, Growl.Connector.RequestInfo requestInfo, bool isIdle, ForwardedNotificationCallbackHandler callbackFunction)

        {
            Forwarder growl = new Forwarder(this.Password, this.IPAddress, this.Port, requestInfo);

            growl.KeyHashAlgorithm = this.HashAlgorithm;

            growl.EncryptionAlgorithm = this.EncryptionAlgorithm;

#if DEBUG
            //growl.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;
#endif

            growl.ForwardedNotificationCallback += callbackFunction;

            growl.Notify(notification, callbackContext);
        }
コード例 #7
0
        public override void ForwardRegistration(Growl.Connector.Application application, List <Growl.Connector.NotificationType> notificationTypes, Growl.Connector.RequestInfo requestInfo, bool isIdle)

        {
            //UoS: stop forwarding registrations to remote clients
            if (!ApplicationMain.NoforwardregistrationMode)
            {
                Forwarder growl = new Forwarder(this.Password, this.IPAddress, this.Port, requestInfo);

                growl.KeyHashAlgorithm = this.HashAlgorithm;

                growl.EncryptionAlgorithm = this.EncryptionAlgorithm;

#if DEBUG
                //growl.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;
#endif

                growl.Register(application, notificationTypes.ToArray());
            }
        }
コード例 #8
0
 /// <summary>
 /// Called when an application registration is received by GfW.
 /// </summary>
 /// <param name="application">The application.</param>
 /// <param name="notificationTypes">The notification types.</param>
 /// <param name="requestInfo">The request info.</param>
 /// <param name="isIdle"><c>true</c> if the user is currently idle;<c>false</c> otherwise</param>
 /// <remarks>
 /// Many types of forwarders can just ignore this event.
 /// </remarks>
 public override void ForwardRegistration(Growl.Connector.Application application,
                                          List <Growl.Connector.NotificationType> notificationTypes,
                                          Growl.Connector.RequestInfo requestInfo, bool isIdle)
 {
     // do nothing
 }
コード例 #9
0
 /// <summary>
 /// Called when a notification is received by GfW.
 /// </summary>
 /// <param name="notification">The notification information</param>
 /// <param name="callbackContext">The callback context.</param>
 /// <param name="requestInfo">The <see cref="Growl.Connector.RequestInfo"/> associated with the notification request</param>
 /// <param name="isIdle"><c>true</c> if the user is currently idle;<c>false</c> otherwise</param>
 /// <param name="callbackFunction">The function GfW will run if this notification is responded to on the forwarded computer</param>
 /// <remarks>
 /// Unless your forwarder is going to handle socket-style callbacks from the remote computer, you should ignore
 /// the <paramref name="callbackFunction"/> parameter.
 /// </remarks>
 public abstract void ForwardNotification(Growl.Connector.Notification notification, Growl.Connector.CallbackContext callbackContext, Growl.Connector.RequestInfo requestInfo, bool isIdle, ForwardedNotificationCallbackHandler callbackFunction);
コード例 #10
0
 /// <summary>
 /// Called when an application registration is received by GfW.
 /// </summary>
 /// <param name="application">The <see cref="Growl.Connector.Application"/> that is registering</param>
 /// <param name="notificationTypes">A list of <see cref="Growl.Connector.NotificationType"/>s being registered</param>
 /// <param name="requestInfo">The <see cref="Growl.Connector.RequestInfo"/> associated with the registration request</param>
 /// <param name="isIdle"><c>true</c> if the user is currently idle;<c>false</c> otherwise</param>
 public abstract void ForwardRegistration(Growl.Connector.Application application, List <Growl.Connector.NotificationType> notificationTypes, Growl.Connector.RequestInfo requestInfo, bool isIdle);