private void btn_Create_Click(object sender, EventArgs e) { if (CB_List.Items != null && CB_List.Items.Count > 0) { string setNameSpace = TB_NameSpace.Text; string path = TB_Location.Text; string prefix = TB_Prefix.Text; if (String.IsNullOrWhiteSpace(setNameSpace)) { MessageBox.Show("네임스페이스가 지정되지 않았습니다."); TB_NameSpace.Focus(); } else if (String.IsNullOrWhiteSpace(path)) { MessageBox.Show("저장경로가 지정되지 않았습니다."); TB_Location.Focus(); } else { pBar.Value = 0; int step = 100 / CB_List.Items.Count; int c_count = 0; IDbQuery query = new MSSQL(); using (var conn = new SqlConnection(this.ConnectionString)) { conn.Open(); string item = string.Empty; for (int i = 0; i < CB_List.Items.Count; i++) { if (CB_List.GetItemChecked(i)) { item = CB_List.Items[i].ToString(); if (this.FileWrite(item, conn, setNameSpace, path, query, prefix)) { c_count++; } } pBar.Value += step; } conn.Close(); } pBar.Value = 100; TB_Message.AppendText($"{c_count}개의 Entity 파일을 생성했습니다.{Environment.NewLine}"); TB_Message.AppendText($"작업이 완료되었습니다.{Environment.NewLine}"); } } else { MessageBox.Show("대상이 지정되지 않았습니다."); } }
void Display_TB_Message(string str) { if (this.InvokeRequired) { Display_TB_Message_Call d = new Display_TB_Message_Call(Display_TB_Message); this.BeginInvoke(d, new object[] { str }); } else { TB_Message.AppendText(str); } }
private void PB_ProtecLog_DoubleClick(object sender, EventArgs e) { mc.main.mainThread.req = false; mc.commMPC.req = false; mc.commMPC.sqc = SQC.STOP; mc.commMPC.deactivate(out ret.message); TB_Message.AppendText("mc.deactivate. ..."); mc.deactivate(out str); TB_Message.AppendText(str + "\n"); //Application.DoEvents(); mc.idle(1000); Application.Exit(); }
private void ConsoleWrite(string msg) { if (TB_Message.InvokeRequired) { TB_Message.BeginInvoke(new Action(() => { TB_Message.AppendText(msg); TB_Message.AppendText(Environment.NewLine); })); } else { TB_Message.AppendText(msg); TB_Message.AppendText(Environment.NewLine); } }