public void UpdatePvSetting(PvSetting entry) { var length = PvSettings.Count; for (int i = 0; i < length; i++) { var s = PvSettings[i]; if (s.PvId == entry.PvId) { PvSettings.RemoveAt(i); break; } } PvSettings.Add(entry); }
public PvSetting GetPvSetting(int id) { foreach (var s in PvSettings) { if (s.PvId == id) { return(s); } } var n = new PvSetting() { PvId = id }; PvSettings.Add(n); return(n); }