Пример #1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            frmMsgBox msg = new frmMsgBox("信息", "确定要生成代码吗?", MsgboxButtonStyle.YesNoCancel, MsgboxIconStyle.Information);

            if (DialogResult.Yes == msg.ShowDialog())
            {
                GenerateCode        gc        = new GenerateCode();
                CodeGenerateControl cgc       = new CodeGenerateControl();
                List <DataTable>    tableList = cgc.GetTablesInDatabase(GetTableNameList());
                if (string.IsNullOrWhiteSpace(txtFolder.Text) || string.IsNullOrWhiteSpace(txtNameSpace.Text))
                {
                    MessageBox.Show("文件夹或命名空间不能为空");
                    return;
                }

                gc.GenerateClassCode(tableList, txtNameSpace.Text, txtFolder.Text);
            }
        }
Пример #2
0
 public void ShowMessage(string text)
 {
     if (this.InvokeRequired)
     {
         frmMsgBox          f = new frmMsgBox();
         Action <frmMsgBox> actionAddrCtrl = (X) =>
         {
             X.setText(text);
             X.ShowDialog();
         };
         Invoke(actionAddrCtrl, f);
     }
     else
     {
         frmMsgBox f = new frmMsgBox();
         f.setText(text);
         f.ShowDialog();
     }
 }
Пример #3
0
        /// <summary>
        /// 窗口形式显示提示信息
        /// </summary>
        /// <param name="msg"></param>
        public static void ShowResult(string msg)
        {
            frmMsgBox msgFrm = new frmMsgBox(msg);

            msgFrm.ShowDialog();
        }