private void btnInsertRightPhone_Click(object sender, EventArgs e) { AdbManager.GetSerialNumbersOfConnectedPhones(out serialNumbers); if (serialNumbers.Length == 1) { if (leftPhoneNumber.Equals(serialNumbers[0])) { lblResult.ForeColor = Color.DarkRed; lblResult.Text = "Left and right phones has the same serial number..."; return; } lblResult.ForeColor = Color.Black; pbInsertRightPhone.BackgroundImage = accept; state = State.WAIT_REMOVE_RIGHT_PHONE; lblResult.Text = "Waiting to remove right phone..."; rightPhoneNumber = serialNumbers[0]; txtBoxRightCellNumber.Text = rightPhoneNumber; return; } lblResult.Text = "Waiting to insert right phone..."; }
private void btnRemoveRightPhone_Click(object sender, EventArgs e) { AdbManager.GetSerialNumbersOfConnectedPhones(out serialNumbers); if (serialNumbers.Length == 0) { pbRemoveRightPhone.BackgroundImage = accept; state = State.WAIT_INSERT_BOTH_PHONES; lblResult.Text = "Waiting to insert both phones..."; return; } lblResult.Text = "Waiting to remove right phone..."; }
private void btnInsertLeftPhone_Click(object sender, EventArgs e) { AdbManager.GetSerialNumbersOfConnectedPhones(out serialNumbers); if (serialNumbers.Length == 1) { pbInsertLeftPhone.BackgroundImage = accept; state = State.WAIT_REMOVE_LEFT_PHONE; lblResult.Text = "Waiting to remove left phone..."; leftPhoneNumber = serialNumbers[0]; txtBoxLeftCellNumber.Text = leftPhoneNumber; return; } lblResult.Text = "Waiting to insert left phone..."; }
private void btnInsert2Phones_Click(object sender, EventArgs e) { AdbManager.GetSerialNumbersOfConnectedPhones(out serialNumbers); if (serialNumbers.Length == 2) { if (!(serialNumbers.Contains(leftPhoneNumber) && serialNumbers.Contains(rightPhoneNumber))) { lblResult.ForeColor = Color.DarkRed; lblResult.Text = "The inserted phones does not have match with the previous phones calibrated."; return; } lblResult.ForeColor = Color.Black; pbInsert2Phones.BackgroundImage = accept; state = State.PHONES_CONFIGURED; lblResult.Text = fp.rm.GetString("uiCellCalibrationResultSuccess"); return; } lblResult.Text = "Waiting to insert both phones..."; }