Exemplo n.º 1
0
 private void OnClientDisconnected(Tunnel.Client client)
 {
     listAdapter.Remove(client);
     RunOnUiThread(delegate() {
         listAdapter.NotifyDataSetChanged();
     });
 }
Exemplo n.º 2
0
 public override void OnCreateContextMenu(IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo)
 {
     base.OnCreateContextMenu(menu, view, menuInfo);
     AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;
     Tunnel.Client client = listAdapter[info.Position];
     menu.SetHeaderTitle("Client " + client.ID + " at " + client.Address);
     menu.Add(Menu.None, 0, 0, "Throw off");
 }
Exemplo n.º 3
0
 protected void OnClientConnected(Tunnel.Client client)
 {
     if (client != null)
     {
         client.LogId = false;
     }
     RunOnUiThread(delegate() {
         SetEnableLight(connectLight);
         connectText.Text = "Client is connected";
         DisableButton(connectButton);
     });
 }
Exemplo n.º 4
0
 protected void OnClientDisconnected(Tunnel.Client client)
 {
     RunOnUiThread(delegate() {
         SetDisableLight(connectLight);
         connectText.Text = "Client is not connected";
         if (tunnel.IsRunning)
         {
             EnableButton(connectButton);
         }
         else
         {
             DisableButton(connectButton);
         }
     });
 }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            //Get our object for this position
            Tunnel.Client item = items[position];

            //Try to reuse convertView if it's not  null, otherwise inflate it from our item layout
            // This gives us some performance gains by not always inflating a new view
            // This will sound familiar to MonoTouch developers with UITableViewCell.DequeueReusableCell()
            LayoutInflater inflater = context.LayoutInflater;
            View           row      = inflater.Inflate(Resource.Layout.ClientListItem, parent, false);

            //Find references to each subview in the list item's view
            //var imageItem = view.FindViewById(Resource.Id.image_item) as ImageView;
            var textTop    = row.FindViewById(Resource.Id.text_top) as TextView;
            var textBottom = row.FindViewById(Resource.Id.text_bottom) as TextView;

            //Assign this item's values to the various subviews
            //imageItem.SetImageResource(item.Image);
            textTop.SetText(item.ID.ToString(), TextView.BufferType.Normal);
            textBottom.SetText(item.Address.ToString(), TextView.BufferType.Normal);

            //Finally return the view
            return(row);
        }
 public void OnClientDisconnected(Tunnel.Client client)
 {
     client.TunnelCommandReceived -= OnTunnelCommand;
 }
 public void OnClientConnected(Tunnel.Client client)
 {
     client.TunnelCommandReceived += OnTunnelCommand;
     clientIpAddress = client.Address;
     Console.WriteLine(clientIpAddress);
 }
 public void Remove(Tunnel.Client client)
 {
     items.Remove(client);
 }
 public void Add(Tunnel.Client client)
 {
     items.Add(client);
 }