Пример #1
0
 public void StopDiscovery()
 {
     if (browser != null)
     {
         browser.Stop();
     }
 }
Пример #2
0
        private void startStopButton_Click(object sender, EventArgs e)
        {
            if (!mBrowsing)
            {
                try
                {
                    Debug.WriteLine(String.Format("Bonjour Version: {0}", NetService.DaemonVersion));
                }
                catch (Exception ex)
                {
                    String message = ex is DNSServiceException ? "Bonjour is not installed!" : ex.Message;
                    MessageBox.Show(message, "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Application.Exit();
                }
            }

            if (!mBrowsing)
            {
                string service = serviceTextBox.Text;

                try
                {
                    nsBrowser.SearchForService(service, "");
                    mBrowsing = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Critical Error");
                }
            }
            else
            {
                nsBrowser.Stop();

                if (resolvingService != null)
                {
                    resolvingService.Stop();
                    resolvingService = null;
                }
                ClearTXTInfo();
                ClearResolveInfo();

                servicesList.BeginUpdate();
                servicesList.Items.Clear();
                servicesList.EndUpdate();

                mBrowsing = false;
            }

            if (mBrowsing)
            {
                startStopButton.Text = "Stop";
            }
            else
            {
                startStopButton.Text = "Start";
            }
        }
Пример #3
0
        public static void StopSearchingForPairingUtility()
        {
            if (_pairingUtilityBrowser == null)
            {
                return;
            }

            _log.Info("Stopping search for pairing utility...");

            UnhookEvents();
            _pairingUtilityBrowser.Stop();

            ThreadUtility.RunOnUIThread(() =>
            {
                DiscoveredPairingUtilities.Clear();
            });

            _pairingUtilityBrowser = null;
        }
Пример #4
0
        public void Stop()
        {
            if (browser != null)
            {
                browser.Stop();
                browser = null;

                lock (serverInfoLock)
                    serverInfos = null;
            }
        }
Пример #5
0
        private static void Stop()
        {
            if (!_serverBrowser.IsRunning)
            {
                return;
            }

            _serverBrowser.Stop();

            lock (DiscoveredServers)
                DiscoveredServers.Clear();
        }
Пример #6
0
        private void startBrowsing()
        {
            if (!mBrowsing)
            {
                try
                {
                    Debug.WriteLine(String.Format("Bonjour Version: {0}", NetService.DaemonVersion));
                }
                catch (Exception ex)
                {
                    String message = ex is DNSServiceException ? "Bonjour is not installed!" : ex.Message;
                    MessageBox.Show(message, "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Application.Exit();
                }
            }

            if (!mBrowsing)
            {
                string service = "_airmagic._tcp";
                try
                {
                    nsBrowser.SearchForService(service, "");
                    mBrowsing = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Critical Error");
                }
            }
            else
            {
                nsBrowser.Stop();

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


                mBrowsing = false;
            }

            if (mBrowsing)
            {
            }
            else
            {
            }
        }
Пример #7
0
        private void StopServiceBrowser()
        {
            if (_browser == null)
            {
                return;
            }

            _browser.ServiceFound   -= _browser_ServiceFound;
            _browser.ServiceRemoved -= _browser_ServiceRemoved;
            _browser.Stop();
            _services.Clear();

            browseStartButton.IsEnabled = true;
            browseStopButton.IsEnabled  = false;
        }
Пример #8
0
        private void StopServiceBrowser()
        {
            StopBrowseButton.IsEnabled = false;

            if (_browser != null)
            {
                _browser.ServiceFound   -= _browser_ServiceFound;
                _browser.ServiceRemoved -= _browser_ServiceRemoved;
                _browser.Stop();
            }

            _discoveredServices = null;
            PageViewSource["DiscoveredServices"] = null;

            StartBrowseButton.IsEnabled = true;
        }
Пример #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (nsBrowser != null)
                {
                    nsBrowser.Stop();
                }
            }
            base.Dispose(disposing);

            Environment.Exit(1);
        }
Пример #10
0
 /// <summary>
 /// Close the PairingServer which stops the mDNS browser and clears the services.
 /// </summary>
 public void Stop()
 {
     Console.WriteLine("Shutting Down DACPPairingServer...");
     nsBrowser.Stop();
     services.Clear();
 }
Пример #11
0
 public void StopSearch()
 {
     browser.Stop();
 }