Esempio n. 1
0
        private void btnGetTypes_Click(object sender, EventArgs e)
        {
            var types = ModelToSQLHelper.GetModelTypes(txtDllPath.Text);

            cbClassNames.DataSource = types;
            //搜索
            cbClassNames.AutoCompleteCustomSource.AddRange(types.Select(t => t.ToString()).ToArray());
            cbClassNames.AutoCompleteSource = AutoCompleteSource.ListItems;
            cbClassNames.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
        }
Esempio n. 2
0
        private void btnGenerateAndCopy_Click(object sender, EventArgs e)
        {
            Type type = (Type)cbClassNames.SelectedItem;

            if (type != null)
            {
                string sql = ModelToSQLHelper.GenerateSQLFromModel(type);
                rtxtSQL.Text = sql;
                Clipboard.SetText(sql);
            }
            else
            {
                MessageBox.Show("请选择一个要生成的类");
            }
        }