示例#1
0
        /// <summary>
        /// Event that handles a new found device
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void DeviceFound(object sender, DeviceEventArgs args)
        {
            //Make it thread-safe
            AddDeviceDelegate AddDeviceInstance = new AddDeviceDelegate(this.AddDevice);

            this.Invoke(AddDeviceInstance, new object[] { args.Device });
        }
 private void AddTextToListBox(string text)
 {
     if (this.listBoxProcurar.InvokeRequired)
     {
         AddDeviceDelegate d = new AddDeviceDelegate(AddTextToListBox);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         listBoxProcurar.Items.Add(text);
     }
 }
 private void AddTextToListBox(string text)
 {
     if (this.listBoxDevices.InvokeRequired)
     {
         AddDeviceDelegate d = new AddDeviceDelegate(AddTextToListBox);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         //buttonFind.Enabled = true;
         listBoxDevices.Items.Add(text);
     }
 }
示例#4
0
 private void AdicionarDispositivoListBox(string text)
 {
     if (this.listBoxDevices.InvokeRequired)
     {
         AddDeviceDelegate d = new AddDeviceDelegate(AdicionarDispositivoListBox);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         pictureBox.Enabled = false;
         listBoxDevices.Items.Add(text);
     }
 }
示例#5
0
 /// <summary>
 /// Event that handles a new found device
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void DeviceFound(object sender, DeviceEventArgs args)
 {
     //Make it thread-safe
     AddDeviceDelegate AddDeviceInstance = new AddDeviceDelegate(this.AddDevice);
     this.Invoke(AddDeviceInstance, new object[] { args.Device });
 }