private void SetTunnelIndicator(IUDPTunnel tunnel, Shape tunnelIndicator) { if (tunnel != null && tunnel.IsTunnelEstablished) { if (Dispatcher.CheckAccess()) { tunnelIndicator.Fill = Brushes.GreenYellow; } else { Dispatcher.Invoke(new Action(() => tunnelIndicator.Fill = Brushes.GreenYellow)); } } else { if (Dispatcher.CheckAccess()) { tunnelIndicator.Fill = Brushes.DarkGray; } else { Dispatcher.Invoke(new Action(() => tunnelIndicator.Fill = Brushes.DarkGray)); } } }
public void CloseTunnel(IUDPTunnel outgoingTunnel) { if (_tunnels.ContainsKey(outgoingTunnel.Id)) { Logger.Debug("Removing tunnel " + outgoingTunnel.Id + " from transportManager"); _tunnels[outgoingTunnel.Id].Tunnel.Close(); _tunnels.Remove(outgoingTunnel.Id); } }
public void AddTunnel(IUDPTunnel tunnel, int priority) { tunnel.ProcessData = ProcessTunnelData; tunnel.Disconnected += TunnelOnDisconnected; _tunnels.Remove(tunnel.Id); _tunnels.Add(tunnel.Id, new TunnelContainer() { Priority = priority, Tunnel = tunnel }); if (_tunnels.Count == 1) { Logger.Debug("TransportManager has become active."); IsActive = true; OnActive(EventArgs.Empty); } }
public void CloseTunnel(IUDPTunnel tunnel) { throw new NotImplementedException(); }
public void AddTunnel(IUDPTunnel tunnel, int priority) { }