void SaveConfig() { var editItem = InterfaceModels.FirstOrDefault(i => i.Id == SelectedInterfaceModel.Id); if (editItem == null) { MessageBox.Show("无法编辑本条记录,请先进行新增操作.", "提示"); return; } editItem.SetValue(SelectedInterfaceModel); }
void AddConfig() { SelectedInterfaceModel.Id = Guid.NewGuid(); InterfaceModels.Add(SelectedInterfaceModel.Clone()); }