summaryrefslogtreecommitdiffstats
path: root/avahi-sharp/ServiceTypeBrowser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-sharp/ServiceTypeBrowser.cs')
-rw-r--r--avahi-sharp/ServiceTypeBrowser.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/avahi-sharp/ServiceTypeBrowser.cs b/avahi-sharp/ServiceTypeBrowser.cs
index 4d996d6..754b9b1 100644
--- a/avahi-sharp/ServiceTypeBrowser.cs
+++ b/avahi-sharp/ServiceTypeBrowser.cs
@@ -40,7 +40,7 @@ namespace Avahi
public delegate void ServiceTypeInfoHandler (object o, ServiceTypeInfo info);
- public class ServiceTypeBrowser : IDisposable
+ public class ServiceTypeBrowser : BrowserBase, IDisposable
{
private IntPtr handle;
private ArrayList infos = new ArrayList ();
@@ -160,17 +160,23 @@ namespace Avahi
info.Flags = flags;
infos.Add (info);
-
- if (bevent == BrowserEvent.Added) {
+
+ switch (bevent) {
+ case BrowserEvent.Added:
infos.Add (info);
foreach (ServiceTypeInfoHandler handler in addListeners)
handler (this, info);
- } else {
+ break;
+ case BrowserEvent.Removed:
infos.Remove (info);
foreach (ServiceTypeInfoHandler handler in removeListeners)
handler (this, info);
+ break;
+ default:
+ EmitBrowserEvent (bevent);
+ break;
}
}
}