Exemplo n.º 1
0
 public PeerDeviceProperties(PeerDevice peerDevice)
 {
     processValidate = false;
     this.PeerDevice = peerDevice;
     InitializeComponent();
     this.UpdateDisplay();
     processValidate = true;
 }
 public PeerDeviceProperties(PeerDevice peerDevice)
 {
     processValidate = false;
     this.PeerDevice = peerDevice;
     InitializeComponent();
     this.UpdateDisplay();
     processValidate = true;
 }
Exemplo n.º 3
0
 private void UpdateDisplay()
 {
     try {
         if (myApp.IsVirtualRouterServiceConnected)
         {
             UpdateUIDisplay();
             var    lines    = myApp.softGetaway.GetTraceLines();
             string lastLine = null;
             foreach (var line in lines)
             {
                 logList.Items.Add(line);
                 lastLine = line;
             }
             if (lastLine != null)
             {
                 logList.Items.MoveCurrentTo(lastLine);
                 logList.ScrollIntoView(lastLine);
             }
             if (varContainer.IsGetawayStartedTrue)
             {
                 var peers = myApp.softGetaway.GetPeers();
                 varContainer.IsClientConnected = peers.Count() > 0;
                 groupBoxPeersConnected.Header  = "Peers Connections/reservations (" + peers.Count().ToString() + "):";
                 foreach (var p in peers)
                 {
                     PeerDevice element = this.isPeerAlreadyConnected(p);
                     if (element == null)
                     {
                         element = new PeerDevice(p);
                         panelConnections.Children.Add(element);
                     }
                     else
                     {
                         element.Peer = p;
                     }
                 }
                 this.removeDisconnectedPeers(peers);
             }
             else
             {
                 groupBoxPeersConnected.Header = "Peers Connected (0):";
                 if (varContainer.IsServiceInstalledFalse)
                 {
                     lblStatus.Content = "Service not Installed";
                 }
                 else
                 if (varContainer.IsServiceStartedFalse)
                 {
                     lblStatus.Content = "Service not Started";
                 }
             }
         }
     } catch { }
 }
Exemplo n.º 4
0
 private void UpdateDisplay()
 {
     try {
         if (myApp.IsVirtualRouterServiceConnected) {
             UpdateUIDisplay();
             var lines = myApp.softGetaway.GetTraceLines();
             string lastLine = null;
             foreach (var line in lines) {
                 logList.Items.Add(line);
                 lastLine = line;
             }
             if (lastLine != null) {
                 logList.Items.MoveCurrentTo(lastLine);
                 logList.ScrollIntoView(lastLine);
             }
             if (varContainer.IsGetawayStartedTrue) {
                 var peers = myApp.softGetaway.GetPeers();
                 varContainer.IsClientConnected = peers.Count() > 0;
                 groupBoxPeersConnected.Header = "Peers Connections/reservations (" + peers.Count().ToString() + "):";
                 foreach (var p in peers) {
                     PeerDevice element = this.isPeerAlreadyConnected(p);
                     if (element == null) {
                         element = new PeerDevice(p);
                         panelConnections.Children.Add(element);
                     } else {
                         element.Peer = p;
                     }
                 }
                 this.removeDisconnectedPeers(peers);
             } else {
                 groupBoxPeersConnected.Header = "Peers Connected (0):";
                 if (varContainer.IsServiceInstalledFalse)
                     lblStatus.Content = "Service not Installed";
                 else
                     if (varContainer.IsServiceStartedFalse)
                         lblStatus.Content = "Service not Started";
             }
         }
     } catch { }
 }