Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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 ();
        }
Ejemplo n.º 4
0
        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;
            }
        }