private void InitLang() { btnView.Text = LangPack.GetPreview(); btnAdd.Text = LangPack.GetAdd(); btnEdit.Text = LangPack.GetEdit(); btnDel.Text = LangPack.GetDelete(); btnKindAdd.Text = LangPack.GetAdd(); btnKindEdit.Text = LangPack.GetEdit(); btnKindDel.Text = LangPack.GetDelete(); btnClose.Text = LangPack.GetClose(); btnClear.Text = LangPack.GetClear(); if (LangPack.IsEng) { label1.Text = "CG Edit"; tabPage2.Text = "Kind List"; tabPage1.Text = "Text List"; } else { label1.Text = "Текст засварлах"; tabPage2.Text = "Мэдээллийн төрөл"; tabPage1.Text = "Текстийн жагсаалт"; } }
public void timeTDMethod() { while (true) { if (this.tmpTime > 0) { MethodInvoker set = delegate() { this.label13.Text = (--this.tmpTime).ToString(); }; if (this.InvokeRequired) { this.Invoke(set); } else { set(); } } if (this.tmpTime == 0) { MethodInvoker btnSet = delegate() { this.btnImd.Enabled = false; this.btnImd.Visible = false; this.btnCancel.Text = LangPack.GetClear(); }; if (this.InvokeRequired) { this.Invoke(btnSet); } else { btnSet(); } if (this.OnCountEndEvt != null) { this.OnCountEndEvt(this, new CountEndEventArgs(this.p24)); } try { this.timeTD.Abort(); } catch (Exception ex) { this.timeTD = null; } break; } Thread.Sleep(1000); } }
/// <summary> /// 취소 버튼 클릭 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCancel_Click(object sender, EventArgs e) { if (this.timeTD != null) { this.timeTD.Abort(); this.timeTD = null; } string tmpStr = LangPack.GetMongolian("Want to cancel the auto alert?"); if (this.btnCancel.Text == LangPack.GetClear()) { tmpStr = LangPack.GetMongolian("Want to cancel the auto alert?"); if (MessageBox.Show(tmpStr, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { if (this.OnCancleEvt != null) { this.OnCancleEvt(this, new CountEndEventArgs(this.p24)); } this.Close(); } } else { if (MessageBox.Show(tmpStr, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { this.tmpTime = (int.Parse(this.label13.Text.ToString()) + 1); this.timeTD = new Thread(timeTDMethod); this.timeTD.IsBackground = true; this.timeTD.Start(); } else { this.Close(); } } }
/// <summary> /// 즉시 방송 버튼 클릭 이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnImd_Click(object sender, EventArgs e) { if (this.OnCountEndEvt != null) { this.OnCountEndEvt(this, new CountEndEventArgs(this.p24)); } try { if (this.timeTD != null) { this.timeTD.Abort(); this.timeTD = null; } } catch (Exception ex) { } this.btnImd.Enabled = false; this.btnImd.Visible = false; this.btnCancel.Text = LangPack.GetClear(); }
/// <summary> /// init 메소드 /// </summary> /// <param name="_p24"></param> public void setInit(PrtCmd24 _p24) { this.p24 = _p24; this.label5.Text = (_p24.DisMode == 0) ? LangPack.GetTest() : (_p24.DisMode == 1) ? LangPack.GetReal() : LangPack.GetDrill(); this.label6.Text = (_p24.DisValue * 0.01).ToString(); if (Util.autoInfo.intensity < (_p24.DisValue * 0.01)) //high { this.label12.Text = (Util.autoInfo.highCBSUse == true) ? LangPack.GetUse() : LangPack.GetNonuse(); this.label11.Text = Util.autoInfo.highMsg; if (Util.autoInfo.highAuto) { this.label13.Text = "0"; tmpTime = 0; this.label4.Text = LangPack.GetAuto(); this.btnCancel.Text = LangPack.GetClear(); } else { this.label13.Text = Util.autoInfo.highTime.ToString(); tmpTime = Util.autoInfo.highTime; this.label4.Text = LangPack.GetManual(); } } else //low { this.label12.Text = (Util.autoInfo.lowCBSUse == true) ? LangPack.GetUse() : LangPack.GetNonuse(); this.label11.Text = Util.autoInfo.lowMsg; if (Util.autoInfo.lowAuto) { this.label13.Text = "0"; tmpTime = 0; this.label4.Text = LangPack.GetAuto(); this.btnCancel.Text = LangPack.GetClear(); } else { this.label13.Text = Util.autoInfo.lowTime.ToString(); tmpTime = Util.autoInfo.lowTime; this.label4.Text = LangPack.GetManual(); } } if (tmpTime != 0) { this.timeTD = new Thread(timeTDMethod); this.timeTD.IsBackground = true; this.timeTD.Start(); } if (this.label4.Text == LangPack.GetAuto()) { this.btnImd.Enabled = false; this.btnImd.Visible = false; } else { this.btnImd.Enabled = true; } }