Beispiel #1
0
 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));
         }
     }
 }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 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));
         }
     }
 }
Beispiel #5
0
 public void CloseTunnel(IUDPTunnel tunnel)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 public void AddTunnel(IUDPTunnel tunnel, int priority)
 {
 }
 public void CloseTunnel(IUDPTunnel tunnel)
 {
     throw new NotImplementedException();
 }
 public void AddTunnel(IUDPTunnel tunnel, int priority)
 {
 }