private void lklblAddGlobal_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { FormAddKeyVal formKv = new FormAddKeyVal("新增全局配置节点"); if (formKv.ShowDialog() == DialogResult.OK) { Dictionary <string, string> kvs = formKv.KeyValue; if (kvs.Count > 0) { List <ConfigData> lstConfigs = XmlSerializion.DeSerializion <List <ConfigData> >(Global_Xml) ?? new List <ConfigData>(); foreach (KeyValuePair <string, string> kv in kvs) { ConfigData configData = new ConfigData() { ConfigPath = Global_Xml, KeyVal = kv.Key, ValueVal = kv.Value, TypeVal = ConfigType.appSettings }; lstConfigs.Add(configData); AddGlobalUI(configData); } XmlSerializion.Seralize(lstConfigs, Global_Xml); } } }
private void lklblLoalGlobal_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "配置文件|*.config"; if (dialog.ShowDialog() == DialogResult.OK) { FormLoadGlobal form = new FormLoadGlobal(dialog.FileName); if (form.ShowDialog() == DialogResult.OK) { List <ConfigData> lstConfig = form.SelectedData; XmlSerializion.Seralize(lstConfig, Global_Xml); LoadGlobal(); } } }
private void KvUi_OnChanged(object sender, EventArgs e) { XmlSerializion.Seralize(GetGlobalData(), Global_Xml); }