public void AddIgnoredError(CellAddress cellAddress, IgnoredError ignoredErrors) { if (!ignoredErrors.IsDifferentFromDefault) { return; } var id = ignoredErrors.GetHashCode(); foreach (var distinctIgnored in DistinctIgnoredErrors) { if (distinctIgnored.IgnoredErrorId == id) { distinctIgnored.Cells.Add(cellAddress); return; } } var newIgnoredError = new XlsxIgnoredError { IgnoredError = ignoredErrors }; newIgnoredError.Cells.Add(cellAddress); DistinctIgnoredErrors.Add(newIgnoredError); }
/// <summary> /// Compare this <see cref="IgnoredError"/> to another <see cref="IgnoredError"/> /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(IgnoredError other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } var thisId = GetHashCode(); var otherId = other.GetHashCode(); return(otherId.Equals(thisId)); }
public XlsxIgnoredError() { Cells = new HashSet <CellAddress>(); _ignoredError = new IgnoredError(); }