public void Dispose() { if (client != null) { client.DeviceAdded -= DeviceAdded; client.DeviceRemoved -= DeviceRemoved; client.Dispose(); } if (source_map != null) { foreach (var kv in source_map) { if (kv.Value != null) { kv.Value.Disconnect(); } } source_map.Clear(); } if (container != null) { foreach (UPnPServerSource source in container.Children) { source.Disconnect(); } ServiceManager.SourceManager.RemoveSource(container); container = null; } }
public void DelayedInitialize() { source_map = new Dictionary <string, UPnPServerSource> (); container = new UPnPContainerSource(); client = new Mono.Upnp.Client(); client.DeviceAdded += DeviceAdded; client.DeviceRemoved += DeviceRemoved; client.BrowseAll(); }
public void DelayedInitialize() { source_map = new Dictionary<string, UPnPServerSource> (); container = new UPnPContainerSource (); client = new Mono.Upnp.Client (); client.DeviceAdded += DeviceAdded; client.DeviceRemoved += DeviceRemoved; client.BrowseAll (); }
public void Dispose() { if (client != null) { client.DeviceAdded -= DeviceAdded; client.DeviceRemoved -= DeviceRemoved; client.Dispose (); } if (source_map != null) { foreach (var kv in source_map) { if (kv.Value != null) { kv.Value.Disconnect (); } } source_map.Clear (); } if (container != null) { foreach (UPnPServerSource source in container.Children) { source.Disconnect (); } ServiceManager.SourceManager.RemoveSource (container); container = null; } }