示例#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
        public static void ChooseServer(ServerConnectionInfo info)
        {
            DisconnectCurrentServer();
            CurrentServer   = null;
            ConnectionState = ServerConnectionState.NoLibrarySelected;

            if (!PairedServers.Contains(info))
            {
                _log.Info("Setting current server to null...");
                SelectedServerInfo = null;
                return;
            }

            _log.Info("Setting current server to: '{0}' ({1})", info.Name, info.ServiceID);
            SelectedServerInfo = info;
            WakeServer();
            AutoConnect();
        }
示例#3
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();
                }
            }
        }