示例#1
0
        private static void BonjourManager_ServiceRemoved(object sender, NetServiceEventArgs e)
        {
            ServerConnectionInfo info = PairedServers.FirstOrDefault(si => si.ServiceID == e.Service.Name);

            if (info != null)
            {
                _log.Info("Bonjour removed service: '{0}' ({1})", info.Name, info.ServiceID);

                info.IsAvailable = false;
            }
        }
示例#2
0
        private static void BonjourManager_ServiceAdded(object sender, NetServiceEventArgs e)
        {
            ServerConnectionInfo info = PairedServers.FirstOrDefault(si => si.ServiceID == e.Service.Name);

            if (info != null)
            {
                _log.Info("Bonjour found service: '{0}' ({1})", info.Name, info.ServiceID);

                info.IsAvailable = true;

                UpdateServerInfoFromBonjour(info);

                // Connect to the server if necessary
                if (SelectedServerInfo == info)
                {
                    AutoConnect();
                }
            }
        }