private void OnServiceFound (object o, ServiceArgs args) { AddDaapServer (args.Service); }
private void OnServiceRemoved (object o, ServiceArgs args) { ThreadAssist.ProxyToMain (delegate { string key = String.Format ("{0}:{1}", args.Service.Name, args.Service.Port); DaapSource source = source_map [key]; source.Disconnect (true); container.RemoveChildSource (source); source_map.Remove (key); if (source_map.Count == 0) { ServiceManager.SourceManager.RemoveSource (container); } }); }