Ejemplo n.º 1
0
 public override void Subscribe()
 {
     if (this.Enabled && !this.isSubscribing)
     {
         this.isSubscribing = true;
         if (this.subscriberID == null) this.subscriberID = Utility.MachineID;
         this.AdditionalDisplayInfo = "connecting...";
         if (this.sc == null)
         {
             Growl.Daemon.Subscriber subscriber = new Growl.Daemon.Subscriber(this.subscriberID, Environment.MachineName, Growl.Connector.GrowlConnector.TCP_PORT);
             this.sc = new Growl.Daemon.SubscriptionConnector(subscriber, this.Password, this.IPAddress, this.Port);
             this.sc.EncryptionAlgorithm = Growl.Connector.Cryptography.SymmetricAlgorithmType.PlainText;
             this.sc.OKResponse += new Growl.Daemon.SubscriptionConnector.ResponseEventHandler(sc_OKResponse);
             this.sc.ErrorResponse += new Growl.Daemon.SubscriptionConnector.ResponseEventHandler(sc_ErrorResponse);
         }
         this.sc.Subscribe();
     }
 }
Ejemplo n.º 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     this.subscriberID = System.Guid.NewGuid().ToString();
     Growl.Daemon.Subscriber subscriber = new Growl.Daemon.Subscriber(this.subscriberID, "Superman", 24000);
     Growl.Daemon.SubscriptionConnector sc = new Growl.Daemon.SubscriptionConnector(subscriber, password, "127.0.0.1");
     sc.EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText;
     sc.OKResponse += new Growl.Daemon.SubscriptionConnector.ResponseEventHandler(sc_OKResponse);
     sc.ErrorResponse += new Growl.Daemon.SubscriptionConnector.ResponseEventHandler(sc_ErrorResponse);
     sc.Subscribe();
 }