public bool Equals(PolyLineM other) => other != null && BoundingBox.Equals(other.BoundingBox) && NumberOfParts.Equals(other.NumberOfParts) && NumberOfPoints.Equals(other.NumberOfPoints) && Parts.SequenceEqual(other.Parts) && Points.SequenceEqual(other.Points) && MeasureRange.Equals(other.MeasureRange) && Measures.SequenceEqual(other.Measures);
public override int GetHashCode() { var partsHashCode = Parts.Aggregate(0, (current, part) => current ^ part.GetHashCode()); var pointsHashCode = Points.Aggregate(0, (current, point) => current ^ point.GetHashCode()); return(BoundingBox.GetHashCode() ^ NumberOfParts.GetHashCode() ^ NumberOfPoints.GetHashCode() ^ partsHashCode ^ pointsHashCode); }
public bool Equals(PolyLineM other, Tolerance tolerance) => other != null && BoundingBox.Equals(other.BoundingBox, tolerance) && NumberOfParts.Equals(other.NumberOfParts) && NumberOfPoints.Equals(other.NumberOfPoints) && Parts.SequenceEqual(other.Parts) && Points.SequenceEqual(other.Points, new TolerantPointEqualityComparer(tolerance)) && MeasureRange.Equals(other.MeasureRange, tolerance) && Measures.SequenceEqual(other.Measures, new TolerantDoubleEqualityComparer(tolerance));
/// <summary> /// Saves information about the file to write into share file. /// </summary> /// <param name="doc">Context XmlDocument</param> /// <returns>XmlElement with serialized PartFile</returns> public XmlElement SaveToXmlShare(XmlDocument doc) { XmlElement elem = doc.CreateElement(XmlName); elem.AppendElementWithValue("numberofparts", NumberOfParts.ToString()); elem.AppendElementWithValue("filename", FileName); elem.AppendElementWithValue("hash", Hash); elem.AppendElementWithValue("size", Size.ToString()); return(elem); }
/// <summary> /// Serializes File into xml. /// </summary> /// <param name="doc">Context XmlDocument</param> /// <returns>XmlElement with serialised filePart</returns> public XmlElement SaveToXml(XmlDocument doc) { XmlElement elem = doc.CreateElement(XmlName); elem.AppendElementWithValue("filepath", FilePath); elem.AppendElementWithValue("numberofparts", NumberOfParts.ToString()); elem.AppendElementWithValue("filename", FileName); elem.AppendElementWithValue("hash", Hash); elem.AppendElementWithValue("size", Size.ToString()); StringBuilder sb = new StringBuilder(); //Writes status of every part into the file as number (0 or 2). Processing parts are saved as missing. for (int i = 0; i < NumberOfParts; ++i) { sb.Append((int)(PartStatus[i] == EPartStatus.Processing ? EPartStatus.Missing : PartStatus[i])); } elem.AppendElementWithValue("partstatus", sb.ToString()); return(elem); }
public bool Equals(Polygon other) => other != null && BoundingBox.Equals(other.BoundingBox) && NumberOfParts.Equals(other.NumberOfParts) && NumberOfPoints.Equals(other.NumberOfPoints) && Parts.SequenceEqual(other.Parts) && Points.SequenceEqual(other.Points);
public bool Equals(Polygon other, Tolerance tolerance) => other != null && BoundingBox.Equals(other.BoundingBox, tolerance) && NumberOfParts.Equals(other.NumberOfParts) && NumberOfPoints.Equals(other.NumberOfPoints) && Parts.SequenceEqual(other.Parts) && Points.SequenceEqual(other.Points, new TolerantPointEqualityComparer(tolerance));