/// <summary> /// 하단의 정보를 선택한 리스트의 정보로 보여준다. /// </summary> private void SetMsgInfo() { if (this.lvMsg.SelectedItems.Count == 0) { tbText.Text = string.Empty; lbNum.Text = "0"; lbTime.Text = "[0 " + LangPack.GetSec() + "]"; } else { ListView.SelectedListViewItemCollection selText = lvMsg.SelectedItems; if (selText == null || selText.Count <= 0) { return; } if (!(lvMsg.Items[selText[0].Index].Tag is MsgInfo)) { return; } MsgInfo msg = lvMsg.Items[selText[0].Index].Tag as MsgInfo; tbText.Text = msg.msgText; lbNum.Text = msg.msgNum; lbTime.Text = "[" + msg.msgTime.ToString() + " " + LangPack.GetSec() + "]"; } }
private void AddListViewItem() { lvMsg.Items.Clear(); foreach (KeyValuePair <string, MsgInfo> pair in msgMng.dicMsg) { MsgInfo msg = pair.Value; ListViewItem item = new ListViewItem(); item.Text = ""; item.Tag = msg; item.ImageIndex = 1; lvMsg.Items.Add(item); item.SubItems.Add(msg.msgNum); item.SubItems.Add(msg.msgName); item.SubItems.Add(msg.msgTime.ToString() + " sec"); item.SubItems.Add(msg.msgText); } new ListViewSortManager( lvMsg, new Type[] { typeof(ListViewTextSort), typeof(ListViewInt32Sort), typeof(ListViewTextSort), typeof(ListViewTextSort), typeof(ListViewTextSort), }, 1, SortOrder.Ascending ); }
private void btnSve_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbName.Text)) { MessageBox.Show(LangPack.GetMongolian("Please enter the name."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Warning); tbName.Focus(); return; } if (string.IsNullOrEmpty(tbText.Text)) { MessageBox.Show(LangPack.GetMongolian("Please enter message Text."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Warning); tbText.Focus(); return; } string stNum = numNo.Value.ToString(); if (msgMng.dicMsg.ContainsKey(stNum)) { if (bAdd) { if (DialogResult.No == MessageBox.Show(LangPack.GetMongolian("Message already exists. Want to overwrite it?"), LangPack.GetMongolian(this.Text), MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { return; } } msgMng.dicMsg[stNum].msgName = tbName.Text; msgMng.dicMsg[stNum].msgText = tbText.Text; msgMng.dicMsg[stNum].msgTime = Convert.ToInt32(numSec.Value); MessageBox.Show(LangPack.GetMongolian("Modified."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MsgInfo msg = new MsgInfo(); msg.msgNum = stNum; msg.msgName = tbName.Text; msg.msgText = tbText.Text; msg.msgTime = Convert.ToInt32(numSec.Value); msgMng.dicMsg.Add(msg.msgNum, msg); MessageBox.Show(LangPack.GetMongolian("Stored."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Information); } //저장메시지 추가 및 수정했음..이 밑에서 이벤트로 전송 if (this.OnStoMsgChangedEvt != null) { this.OnStoMsgChangedEvt(this, new StoredMsgChangedEventArgs()); } }
private void btnEnd_Click(object sender, EventArgs e) { ListView.CheckedListViewItemCollection selText = lvMsg.CheckedItems; if (selText == null || selText.Count <= 0) { MessageBox.Show(LangPack.GetMongolian("Please select stored message."), LangPack.GetMongolian("Stored Message"), MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } MsgInfo msg = lvMsg.Items[selText[0].Index].Tag as MsgInfo; msg.msgReptCtn = numRptCnt.Value.ToString(); if (evtMsgInfo != null) { evtMsgInfo(Convert.ToByte(msg.msgNum), Convert.ToByte(numRptCnt.Value)); } }
public void OrderStart(object info) { progressBar.Value = 0; lbTime.Text = "0 / 0 " + LangPack.GetSec(); if (info is SirenInfo) { SirenInfo sInfo = info as SirenInfo; progressBar.Maximum = sInfo.SirenTime; lbKind.Text = "[SIREN] " + sInfo.SirenName; } else { MsgInfo mInfo = info as MsgInfo; progressBar.Maximum = (mInfo.msgTime * int.Parse(mInfo.msgReptCtn)); lbKind.Text = LangPack.GetProgressMsg() + mInfo.msgName; } this.timer.Start(); }
private void lvMsg_SelectedIndexChanged(object sender, EventArgs e) { ListView.SelectedListViewItemCollection selText = lvMsg.SelectedItems; if (selText == null || selText.Count <= 0) { this.SetMsgInfo(); return; } if (!(lvMsg.Items[selText[0].Index].Tag is MsgInfo)) { this.SetMsgInfo(); return; } MsgInfo msg = lvMsg.Items[selText[0].Index].Tag as MsgInfo; tbText.Text = msg.msgText; lbNum.Text = msg.msgNum; lbTime.Text = "[" + msg.msgTime.ToString() + " " + LangPack.GetSec() + "]"; }
public void SetModeInfo(byte mode) { this.lvMsg.Items.Clear(); this.curMode = mode; this.numRptCnt.Value = 1; foreach (KeyValuePair <string, MsgInfo> pair in msgMng.dicMsg) { MsgInfo msg = pair.Value as MsgInfo; ListViewItem item = new ListViewItem(); item.Text = ""; item.Name = msg.msgNum; item.Tag = msg; lvMsg.Items.Add(item); item.SubItems.Add(msg.msgNum); item.SubItems.Add(msg.msgName); } lvMsg.Sort(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); InitLang(); this.stoMsg = StMsgDataMng.GetMsgMng(); foreach (KeyValuePair <string, MsgInfo> pair in stoMsg.dicMsg) { MsgInfo msg = pair.Value; comboBox1.Items.Add("(" + msg.msgNum + ")" + msg.msgName); comboBox2.Items.Add("(" + msg.msgNum + ")" + msg.msgName); } this.numericUpDown1.Value = (decimal)Util.autoInfo.intensity; if (Util.autoInfo.highAuto) { this.radioButton1.Checked = true; RadioButton rb = new RadioButton(); rb.Tag = "ha"; rb.Checked = true; this.radioButton1_CheckedChanged((object)rb, new EventArgs()); } else { this.radioButton2.Checked = true; RadioButton rb = new RadioButton(); rb.Tag = "hm"; rb.Checked = true; this.radioButton1_CheckedChanged((object)rb, new EventArgs()); } if (Util.autoInfo.lowAuto) { this.radioButton3.Checked = true; RadioButton rb = new RadioButton(); rb.Tag = "la"; rb.Checked = true; this.radioButton3_CheckedChanged((object)rb, new EventArgs()); } else { this.radioButton4.Checked = true; RadioButton rb = new RadioButton(); rb.Tag = "lm"; rb.Checked = true; this.radioButton3_CheckedChanged((object)rb, new EventArgs()); } if (Util.autoInfo.highMsg != string.Empty) { this.comboBox1.SelectedItem = Util.autoInfo.highMsg; } if (Util.autoInfo.lowMsg != string.Empty) { this.comboBox2.SelectedItem = Util.autoInfo.lowMsg; } this.numericUpDown2.Value = Util.autoInfo.highTime; this.numericUpDown3.Value = Util.autoInfo.lowTime; this.checkBox1.Checked = Util.autoInfo.highCBSUse; this.checkBox2.Checked = Util.autoInfo.lowCBSUse; }