private void savepluginxml() { plugin.title = txttitle.Text; plugin.author = txtauthor.Text; plugin.version = txtversion.Text; if (plugin.data.FindIndex(x => x.key == "introduction") > -1) { plugin.data.Find(x => x.key == "introduction").value = txtintroduction.Text; } else { baseinfodataClass data = new baseinfodataClass(); data.key = "introduction"; data.value = txtintroduction.Text; plugin.data.Add(data); } if (plugin.data.FindIndex(x => x.key == "headpic") > -1) { plugin.data.Find(x => x.key == "headpic").value = pb_headpic.Tag.ToString(); } else { baseinfodataClass data = new baseinfodataClass(); data.key = "headpic"; data.value = pb_headpic.Tag.ToString(); plugin.data.Add(data); } if (plugin.data.FindIndex(x => x.key == "updaterecord") > -1) { plugin.data.Find(x => x.key == "updaterecord").value = txtupdaterecord.Text; } else { baseinfodataClass data = new baseinfodataClass(); data.key = "updaterecord"; data.value = txtupdaterecord.Text; plugin.data.Add(data); } if (plugin.data.FindIndex(x => x.key == "StartItem") > -1) { plugin.data.Find(x => x.key == "StartItem").value = txtStartItem.Text; } else { baseinfodataClass data = new baseinfodataClass(); data.key = "StartItem"; data.value = txtStartItem.Text; plugin.data.Add(data); } PluginXmlManage.pluginfile = path; PluginXmlManage.savepluginclass(plugin); }
private void btnbasedataadd_Click(object sender, EventArgs e) { if (txtbasedatakey.Text.Trim() == "") { MessageBoxEx.Show("不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (plugin.data.FindIndex(x => x.key == txtbasedatakey.Text.Trim()) == -1) { baseinfodataClass data = new baseinfodataClass(); data.key = txtbasedatakey.Text; data.value = txtbasedatavalue.Text; plugin.data.Add(data); } else { baseinfodataClass data = plugin.data.Find(x => x.key == txtbasedatakey.Text.Trim()); data.key = txtbasedatakey.Text; data.value = txtbasedatavalue.Text; } gridbasedata.DataSource = null; gridbasedata.DataSource = plugin.data; }