Esempio n. 1
0
		// 编辑逻辑名
		private void menu_editLogicName_Click(object sender, System.EventArgs e)
		{
			if (this.listView_logicName.SelectedItems.Count == 0)
			{
				MessageBox.Show("尚未选择要编辑的事项...");
				return;
			}

			OneLogicNameDlg dlg = new OneLogicNameDlg();
            dlg.Font = GuiUtil.GetDefaultFont();
            dlg.textBox_lang.Text = this.listView_logicName.SelectedItems[0].Text;
			dlg.textBox_value.Text = this.listView_logicName.SelectedItems[0].SubItems[1].Text;
			dlg.ShowDialog(this);

			if (dlg.DialogResult != DialogResult.OK)
				return;

			this.listView_logicName.SelectedItems[0].Text = dlg.textBox_lang.Text;
			this.listView_logicName.SelectedItems[0].SubItems[1].Text = dlg.textBox_value.Text;

			this.Changed = true;

			AfterLogicNameChanged();
		}
Esempio n. 2
0
		// 新增逻辑名
		private void menu_newLogicName_Click(object sender, System.EventArgs e)
		{
			OneLogicNameDlg dlg = new OneLogicNameDlg();
            dlg.Font = GuiUtil.GetDefaultFont();
            dlg.StartPosition = FormStartPosition.CenterScreen;
			dlg.ShowDialog(this);

			if (dlg.DialogResult != DialogResult.OK)
				return;

			ListViewItem item = new ListViewItem(dlg.textBox_lang.Text, 0);
			item.SubItems.Add(dlg.textBox_value.Text);
			listView_logicName.Items.Add(item);

			this.Changed = true;

			AfterLogicNameChanged();
		}