Example #1
0
        public void Dispose()
        {
            if (locator != null)
            {
                locator.Stop();
                locator.Found   -= OnServiceFound;
                locator.Removed -= OnServiceRemoved;
                locator          = null;
            }

            if (proxy_server != null)
            {
                proxy_server.Stop();
                proxy_server = null;
            }

            var uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service != null)
            {
                uia_service.UIManager.RemoveUi(actions_id);
                uia_service.GlobalActions.Remove("AddRemoteDaapServerAction");
            }

            // Dispose any remaining child sources
            if (source_map != null)
            {
                foreach (KeyValuePair <string, DaapSource> kv in source_map)
                {
                    if (kv.Value != null)
                    {
                        kv.Value.Disconnect(true);
                        kv.Value.Dispose();
                    }
                }

                source_map.Clear();
            }

            if (container != null)
            {
                ServiceManager.SourceManager.RemoveSource(container, true);
                container = null;
            }
        }
Example #2
0
        public void Dispose()
        {
            if (locator != null)
            {
                locator.Stop();
                locator.Found   -= OnServiceFound;
                locator.Removed -= OnServiceRemoved;
                locator          = null;
            }

            if (proxy_server != null)
            {
                proxy_server.Stop();
                proxy_server = null;
            }

            // Dispose any remaining child sources
            if (source_map != null)
            {
                foreach (KeyValuePair <string, DaapSource> kv in source_map)
                {
                    if (kv.Value != null)
                    {
                        kv.Value.Disconnect(true);
                        kv.Value.Dispose();
                    }
                }

                source_map.Clear();
            }

            if (container != null)
            {
                ServiceManager.SourceManager.RemoveSource(container, true);
                container = null;
            }
        }