Ejemplo n.º 1
0
 internal void SetBatteryLevels(string batteryLevel1, string batteryLevel2)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.wiimote1BatteryLevel.InvokeRequired)
     {
         SetBatteryLevelsCallback d = new SetBatteryLevelsCallback(SetBatteryLevels);
         this.Invoke(d, new object[] { batteryLevel1, batteryLevel2 });
     }
     else
     {
         this.wiimote1BatteryLevel.Text = batteryLevel1 + " %";
         this.wiimote2BatteryLevel.Text = batteryLevel2 + " %";
     }
 }
Ejemplo n.º 2
0
 internal void SetBatteryLevels(string batteryLevel1, string batteryLevel2)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.wiimote1BatteryLevel.InvokeRequired)
     {
         SetBatteryLevelsCallback d = new SetBatteryLevelsCallback(SetBatteryLevels);
         this.Invoke(d, new object[] { batteryLevel1, batteryLevel2 });
     }
     else
     {
         this.wiimote1BatteryLevel.Text = batteryLevel1 + " %";
         this.wiimote2BatteryLevel.Text = batteryLevel2 + " %";
     }
 }