예제 #1
0
        void service_Resolved(object o, ServiceResolvedEventArgs args)

        {
            IResolvableService service = args.Service;

            service.Resolved -= new ServiceResolvedEventHandler(service_Resolved);



            DestinationPlatformType fcPlatform = KnownDestinationPlatformType.Other;

            if (service.TxtRecord != null)

            {
                foreach (TxtRecordItem record in service.TxtRecord)

                {
                    if (record.Key == "platform")

                    {
                        string platform = record.ValueString;

                        fcPlatform = KnownDestinationPlatformType.FromString(platform);

                        break;
                    }
                }
            }

            BonjourEventArgs e = new BonjourEventArgs(fcPlatform);



            this.OnServiceFound(service, e);
        }
        void sc_OKResponse(Growl.Daemon.SubscriptionResponse response)
        {
            this.isSubscribing = false;
            string additionalInfo = (this.Enabled ? String.Format("TTL: {0}", response.TTL) : null);

            this.Platform = KnownDestinationPlatformType.FromString(response.PlatformName);
            ChangeStatus(true, additionalInfo);

            // if the subscription succeeds, the SubscriptionConnecter will take care of keeping the subscription alive
        }
예제 #3
0
            public object GetRealObject(StreamingContext context)

            {
                return(KnownDestinationPlatformType.FromString(platform));
            }
예제 #4
0
        public SubscribedForwardDestination(Growl.Daemon.Subscriber subscriber, int ttl)

            : this(subscriber.Name, true, subscriber.IPAddress, subscriber.Port, subscriber.Key.Password, KnownDestinationPlatformType.FromString(subscriber.PlatformName), ttl)

        {
            base.Key = subscriber.ID;

            this.hashAlgorithm = subscriber.Key.HashAlgorithm;

            this.encryptionAlgorithm = subscriber.Key.EncryptionAlgorithm;
        }