예제 #1
0
 // Update devices
 private void updatetimer_Tick(object sender, EventArgs e)
 {
     if (selecteddevice == -1)
     {
         ObexBluetoothDevice[] devices = new ObexBluetoothDevice[0];
         if (General.Obex.GetBluetoothDevices(ref devices))
         {
             for (int i = 0; i < NUM_DEVICE_BUTTONS; i++)
             {
                 if (i < devices.Length)
                 {
                     ObexBluetoothDevice d = devices[i];
                     devicebuttons[i].Text = d.name;
                     devicebuttons[i].Tag  = d;
                     devicebuttons[i].SetupColors(General.Colors);
                     devicebuttons[i].Visible   = true;
                     transferbuttons[i].Enabled = false;
                     transferbuttons[i].SetupColors(General.Colors);
                     transferbuttons[i].Visible = true;
                 }
                 else
                 {
                     devicebuttons[i].Visible   = false;
                     transferbuttons[i].Visible = false;
                 }
             }
         }
     }
 }
예제 #2
0
 // Get bluetooth devices info. Returns false when access is locked. (during updates)
 public bool GetBluetoothDevices(ref ObexBluetoothDevice[] devices)
 {
     lock(this)
     {
         devices = (ObexBluetoothDevice[])devicesinfo.Clone();
     }
     return true;
 }
예제 #3
0
        // Transfer clicked
        private void transferbutton_Click(object sender, EventArgs e)
        {
            ObexBluetoothDevice dev = (ObexBluetoothDevice)devicebuttons[selecteddevice].Tag;

            foreach (ObexTransferObject obj in transferobjs)
            {
                obj.Target = dev;
                General.Obex.SendObject(obj);
            }

            Deselect();
        }
 // Update devices
 private void updatetimer_Tick(object sender, EventArgs e)
 {
     if(selecteddevice == -1)
     {
         ObexBluetoothDevice[] devices = new ObexBluetoothDevice[0];
         if(General.Obex.GetBluetoothDevices(ref devices))
         {
             for(int i = 0; i < NUM_DEVICE_BUTTONS; i++)
             {
                 if(i < devices.Length)
                 {
                     ObexBluetoothDevice d = devices[i];
                     devicebuttons[i].Text = d.name;
                     devicebuttons[i].Tag = d;
                     devicebuttons[i].SetupColors(General.Colors);
                     devicebuttons[i].Visible = true;
                     transferbuttons[i].Enabled = false;
                     transferbuttons[i].SetupColors(General.Colors);
                     transferbuttons[i].Visible = true;
                 }
                 else
                 {
                     devicebuttons[i].Visible = false;
                     transferbuttons[i].Visible = false;
                 }
             }
         }
     }
 }