Avahi.ServiceBrowser.OnServiceBrowserCallback C# (CSharp) Méthode

OnServiceBrowserCallback() private méthode

private OnServiceBrowserCallback ( IntPtr browser, int iface, Protocol proto, BrowserEvent bevent, IntPtr name, IntPtr type, IntPtr domain, LookupResultFlags flags, IntPtr userdata ) : void
browser System.IntPtr
iface int
proto Protocol
bevent BrowserEvent
name System.IntPtr
type System.IntPtr
domain System.IntPtr
flags LookupResultFlags
userdata System.IntPtr
Résultat void
        private void OnServiceBrowserCallback(IntPtr browser, int iface, Protocol proto, BrowserEvent bevent,
                                               IntPtr name, IntPtr type, IntPtr domain, LookupResultFlags flags,
                                               IntPtr userdata)
        {
            ServiceInfo info;
            info.NetworkInterface = iface;
            info.Protocol = proto;
            info.Domain = Utility.PtrToString (domain);
            info.ServiceType = Utility.PtrToString (type);
            info.Name = Utility.PtrToString (name);
            info.HostName = null;
            info.Address = null;
            info.Port = 0;
            info.Text = null;
            info.Flags = flags;

            switch (bevent) {
            case BrowserEvent.Added:
                infos.Add (info);

                foreach (ServiceInfoHandler handler in addListeners)
                    handler (this, new ServiceInfoArgs (info));

                break;
            case BrowserEvent.Removed:
                infos.Remove (info);

                foreach (ServiceInfoHandler handler in removeListeners)
                    handler (this, new ServiceInfoArgs (info));

                break;
            default:
                EmitBrowserEvent (bevent);
                break;
            }
        }