public void Remove(SpectralSet set) { _sets.Remove(set); if (!_sets.Any()) { Resolution = null; } }
public void Add(SpectralSet set) { if (set.Resolution != resolution) { //Throw an Exception here, or however you want to handle invalid data _sets.Add(set); } }
public void Add(SpectralSet set) { var resolutionSet = _sets.FirstOrDefault(s => s.Resolution != null); if (resolutionSet != null && resolutionSet.Resolution != set.Resolution) { //Throw the exception here _sets.Add(set); } Resolution = set.Resolution; }
public void Add(SpectralSet set) { //Do validation here, throw an exception or whatever you want to do if the set isn't valid _sets.Add(set); }