private void tabControl1_SelectedTabChanging(object sender, SuperTabStripSelectedTabChangingEventArgs e) { if (this.tabControl1.SelectedTab != null && this.tabControl1.SelectedTab.Tag != null) { this.SaveCodes(); } }
private async void superTabControl1_SelectedTabChanging(object sender, SuperTabStripSelectedTabChangingEventArgs e) { if (string.IsNullOrEmpty(textBoxX1.Text)) { e.Cancel = true; MessageBoxEx.Show("命名空间不能为空"); return; } if (e.NewValue.Text == "生成代码") { var codeGenerate = new CodeGenerate(); var taskBuild = new TaskBuild() { Fsql = G.GetFreeSql(_node.DataKey), DbName = _node.Parent.Text, NamespaceName = textBoxX1.Text, RemoveStr = textBoxX2.Text, OptionsEntity01 = checkBoxX1.Checked, OptionsEntity02 = checkBoxX2.Checked, OptionsEntity03 = checkBoxX3.Checked, OptionsEntity04 = checkBoxX4.Checked }; editorCode.Text = await codeGenerate.Setup(taskBuild, editorTemplates.Text, dbTableInfos, dbTableInfo); } }
/// <summary> /// Handles SelectedTabChanging events /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void TabStripSelectedTabChanging(object sender, SuperTabStripSelectedTabChangingEventArgs e) { if (SelectedTabChanging != null) SelectedTabChanging(this, e); }