X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-sharp%2FDomainBrowser.cs;h=08f2b35a08219aca95f6af21d499e19afada55ee;hb=59d6820e1866dc65cfec7536f95906e186765016;hp=fb32e774e19865693b7d3bffb03b3c375ea4c54d;hpb=cc272cf44768c9292879a9ee43783fec4b510ffd;p=catta diff --git a/avahi-sharp/DomainBrowser.cs b/avahi-sharp/DomainBrowser.cs index fb32e77..08f2b35 100644 --- a/avahi-sharp/DomainBrowser.cs +++ b/avahi-sharp/DomainBrowser.cs @@ -29,10 +29,10 @@ namespace Avahi IntPtr domain, LookupResultFlags flags, IntPtr userdata); public enum DomainBrowserType { - Register, - RegisterDefault, Browse, BrowseDefault, + Register, + RegisterDefault, BrowseLegacy } @@ -46,7 +46,7 @@ namespace Avahi public delegate void DomainInfoHandler (object o, DomainInfo info); - public class DomainBrowser : IDisposable + public class DomainBrowser : BrowserBase, IDisposable { private IntPtr handle; private ArrayList infos = new ArrayList (); @@ -161,17 +161,23 @@ namespace Avahi info.Flags = flags; infos.Add (info); - - if (bevent == BrowserEvent.Added) { + + switch (bevent) { + case BrowserEvent.Added: infos.Add (info); foreach (DomainInfoHandler handler in addListeners) handler (this, info); - } else { + break; + case BrowserEvent.Removed: infos.Remove (info); foreach (DomainInfoHandler handler in removeListeners) handler (this, info); + break; + default: + EmitBrowserEvent (bevent); + break; } } }