/// <summary>
        /// After this manager tries to connect to a station, the station replies.
        /// This method is called when the reply is received.
        /// </summary>
        /// <param name="ip"> the IP adress of the replying station</param>
        /// <returns> the password the user has typed in the AcceptStationDialog</returns>
        public string IncomingReply(IPEndPoint ip)
        {
            var acd    = new AcceptStationDialog(ip, _ui);
            var result = acd.ShowDialog();

            if (result.HasValue && result == true)
            {
                return(acd.TypedPassword);
            }

            return("");
        }
Exemplo n.º 2
0
        /// <summary>
        /// After this manager tries to connect to a station, the station replies.
        /// This method is called when the reply is received.
        /// </summary>
        /// <param name="ip">
        /// the IP adress of the replying station
        /// </param>
        /// <returns>
        /// the password the user has typed in the AcceptStationDialog
        /// </returns>
        public string IncomingReply(IPEndPoint ip)
        {
            AcceptStationDialog acd    = null;
            Boolean             result = false;

            _ui._stationWindow.Dispatcher.Invoke(
                System.Windows.Threading.DispatcherPriority.Normal,
                new Action(
                    delegate {
                acd       = new AcceptStationDialog(ip, _ui);
                acd.Owner = _ui._stationWindow;
                result    = (Boolean)acd.ShowDialog();
            }));

            if (result == true)
            {
                return(acd.TypedPassword);
            }

            return(string.Empty);
        }