Ejemplo n.º 1
0
        private void txtBandF_Leave(object sender, EventArgs e)
        {
            if (dgvBand.SelectedRows == null)
            {
                return;
            }
            if (dgvBand.SelectedRows.Count < 1)
            {
                return;
            }
            cBand bd = dgvBand.SelectedRows[0].DataBoundItem as cBand;

            if (bd == null)
            {
                return;
            }

            //重複チェック
            if (txtBandF.Text != bd.NameF)
            {
                foreach (cBand b in _blBand)
                {
                    if (txtBandF.Text == b.NameF)
                    {
                        ErrMsg("入力された周波数帯名はすでに存在します(重複不可)。\n入力値:" + txtBandF.Text); return;
                    }
                }
                bd.NameF = txtBandF.Text;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Bandの値からComboBoxを設定する
 /// </summary>
 private void SetBandComboBox()
 {
     //Bandの値から
     for (int i = 0; i < cboBand.Items.Count; i++)
     {
         cBand bd = cboBand.Items[i] as cBand;
         if (bd == null)
         {
             continue;
         }                                            //安全装置
         if (bd.NameF == _QSO.Band)
         {
             cboBand.SelectedIndex = i; break;
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Band(コンボボックス)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cboBand_SelectedIndexChanged(object sender, EventArgs e)
        {
            cBand bd = cboBand.SelectedItem as cBand;

            if (bd == null)
            {
                ErrMsg("無効な周波数選択です。");
            }                                                    //安全装置
            _QSO.Band = bd.NameF;

            string sBn = _QSO.Freq.ToString() + "MHz";

            if ((_QSO.Freq < bd.Lower || bd.Upper < _QSO.Freq) && sBn != bd.NameF)
            {
                MessageBox.Show(string.Format("周波数帯と周波数が矛盾しています。\n周波数帯「{0}」の範囲:{1}~{2}MHz\n周波数:{3}MHz", bd.NameF, bd.Lower, bd.Upper, _QSO.Freq),
                                "確認", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 4
0
        private void txtBandL_Leave(object sender, EventArgs e)
        {
            if (dgvBand.SelectedRows == null)
            {
                return;
            }
            if (dgvBand.SelectedRows.Count < 1)
            {
                return;
            }
            cBand bd = dgvBand.SelectedRows[0].DataBoundItem as cBand;

            if (bd == null)
            {
                return;
            }
            bd.NameL = txtBandL.Text;
        }
Ejemplo n.º 5
0
        private void dgvBand_SelectionChanged(object sender, EventArgs e)
        {
            if (dgvBand.SelectedRows == null)
            {
                return;
            }
            if (dgvBand.SelectedRows.Count < 1)
            {
                return;
            }
            cBand bd = dgvBand.SelectedRows[0].DataBoundItem as cBand;

            if (bd == null)
            {
                return;
            }
            txtBandF.Text = bd.NameF;
            txtBandL.Text = bd.NameL;
            txtLower.Text = bd.Lower.ToString();
            txtUpper.Text = bd.Upper.ToString();
        }
Ejemplo n.º 6
0
        private void txtUpper_Leave(object sender, EventArgs e)
        {
            if (dgvBand.SelectedRows == null)
            {
                return;
            }
            if (dgvBand.SelectedRows.Count < 1)
            {
                return;
            }
            cBand bd = dgvBand.SelectedRows[0].DataBoundItem as cBand;

            if (bd == null)
            {
                return;
            }
            double dU;

            if (!double.TryParse(txtUpper.Text, out dU))
            {
                ErrMsg("上限周波数の書式が不正です。\n入力値:" + txtUpper.Text); return;
            }
            bd.Upper = dU;
        }