/// <summary> /// Handles the ServiceFound event of the agent control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Acn.Slp.ServiceFoundEventArgs"/> instance containing the event data.</param> void agent_ServiceFound(object sender, ServiceFoundEventArgs e) { foreach (UrlEntry url in e.Urls) { bool newDevice = false; SlpDeviceInformation device; lock (devicesLock) { if (!devices.TryGetValue(url.Url, out device)) { device = new SlpDeviceInformation() { Url = url.Url, FirstUpdateId = e.RequestId }; devices[url.Url] = device; } device.Endpoint = e.Address; device.DiscoveryAgents.Add(sender as SlpUserAgent); device.UpdateRecieved(e.RequestId); } RequestAttributes(device); if (newDevice) { OnDeviceStateChange(device); } } OnDevicesUpdated(); }
void slpUser_ServiceFound(object sender, ServiceFoundEventArgs e) { foreach (UrlEntry url in e.Urls) { RdmEndPoint controlEndpoint = new RdmEndPoint(new IPEndPoint(e.Address.Address, RdmNetSocket.RdmNetPort), 0) { Id = UId.ParseUrl(url.Url) }; ControlEndpoints.Add(controlEndpoint); DiscoverEndpoints(controlEndpoint); } }
void slpUser_ServiceFound(object sender, ServiceFoundEventArgs e) { if (InvokeRequired) { BeginInvoke(new EventHandler <ServiceFoundEventArgs>(slpUser_ServiceFound), sender, e); return; } foreach (UrlEntry url in e.Urls) { deviceList.Items.Add(url.Url); } }
void slpUser_ServiceFound(object sender, ServiceFoundEventArgs e) { if (InvokeRequired) { BeginInvoke(new EventHandler <ServiceFoundEventArgs>(slpUser_ServiceFound), sender, e); return; } foreach (UrlEntry url in e.Urls) { AddDevice(UId.ParseUrl(url.Url), e.Address.Address); } }