コード例 #1
0
        /// <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();
        }
コード例 #2
0
ファイル: RdmNetEndPointExplorer.cs プロジェクト: Farrser/ACN
 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);
     }
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }