private void btRenameSchema_Click(object sender, EventArgs e) { if (curItem == null) { return; } string schemaName; if (!I3GetStringForm.Excute("输入方案名称", curItem.SchemaName, out schemaName, false, false)) { return; } if (string.Equals(curItem.SchemaName, schemaName)) { return; } if (settingItems.Keys.Contains(schemaName)) { MessageBox.Show("方案名称已存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存当前数据 settingItems.Remove(curItem.SchemaName); curItem.SchemaName = schemaName; SaveItem(); settingItems.Add(curItem.SchemaName, curItem); //重新加载 LoadItems(); CurItem = curItem; }
private void btCopy_Click(object sender, EventArgs e) { if (curItem == null) { return; } string schemaName; if (!I3GetStringForm.Excute("输入方案名称", "", out schemaName, false, false)) { return; } if (settingItems.Keys.Contains(schemaName)) { MessageBox.Show("方案名称已存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存当前数据 SaveItem(); //新增 SettingItem settingItem = new SettingItem(schemaName); I3ObjectUtil.DeepCopyProperty(curItem, settingItem); //复制属性 settingItem.SchemaName = schemaName; //重新设置名称 settingItems.Add(settingItem.SchemaName, settingItem); LoadItems(); CurItem = settingItem; }
private void button2_Click(object sender, EventArgs e) { if (lbSchemeList.FocusedItem == null) { return; } string schemeName = lbSchemeList.Items[lbSchemeList.FocusedItem.Index].Text; if (!I3GetStringForm.Excute("新建方案", schemeName, out schemeName, false)) { return; } if (string.IsNullOrEmpty(schemeName)) { return; } lbSchemeList.Items[lbSchemeList.FocusedItem.Index].Text = schemeName; iecT_Ini1.SetString("Total", "Name_" + (lbSchemeList.FocusedItem.Index + 1).ToString(), schemeName); iecT_Ini1.Updata(); }
private void btAddSchema_Click(object sender, EventArgs e) { string schemaName; if (!I3GetStringForm.Excute("输入方案名称", "", out schemaName, false, false)) { return; } if (settingItems.Keys.Contains(schemaName)) { MessageBox.Show("方案名称已存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存当前数据 SaveItem(); //新增 SettingItem settingItem = new SettingItem(schemaName); settingItems.Add(settingItem.SchemaName, settingItem); LoadItems(); CurItem = settingItem; }
private void btAddScheme_Click(object sender, EventArgs e) { string schemeName = "新建方案"; if (!I3GetStringForm.Excute("新建方案", schemeName, out schemeName, false)) { return; } if (string.IsNullOrEmpty(schemeName)) { return; } int count = iecT_Ini1.GetInt("Total", "Count", 0); count++; iecT_Ini1.SetInt("Total", "Count", count); iecT_Ini1.SetString("Total", "Name_" + count.ToString(), schemeName); iecT_Ini1.Updata(); searchInfo.WriteToIni(iecT_Ini1, "Scheme_" + count.ToString()); RefreshSchemeList(count - 1); }
private void btShowConnectionString_Click(object sender, EventArgs e) { string cs = GetConnectionString(); I3GetStringForm.Excute("", cs, out cs, false, true); }
/// <summary> /// 显示一个窗口,以获取一个字符串,返回true后可通过属性Str得到该字符串 /// isPassWord:是否以获取密码的形式 /// /// 错误处理:无 /// /// </summary> /// <param name="caption"></param> /// <param name="text"></param> /// <param name="isPassWord"></param> /// <returns></returns> public bool Excute(string caption, string text, bool isPassWord, bool canNull) { return(I3GetStringForm.Excute(caption, text, out str, isPassWord, canNull)); }