private void BuildAdvertisementForService(UpnpService service) { var ad = CreateAdvertisement(service.Type.ToString(), string.Format("{0}::{1}", service.Device.UDN, service.Type)); EventHandler <EventArgs <UpnpService> > onRemoved = null; onRemoved = (sender, args) => { ad.Shutdown(); this.Announcers.Remove(ad); service.Removed -= onRemoved; }; service.Removed += onRemoved; }
protected virtual UpnpService FindMatchFor(UpnpService service, IEnumerable <UpnpService> services) { return(services.FirstOrDefault(child => service.Id == child.Id)); }
protected virtual void CompareService(UpnpService to, UpnpService from) { }
protected virtual void ServiceRemoved(UpnpDevice device, UpnpService service) { }