public int CompareTo(PDFPoint other) { PDFUnit me = this.X.ToPoints() + this.Y.ToPoints(); PDFUnit them = other.X.ToPoints() + other.Y.ToPoints(); if (me.Equals(them)) { me = this.X.ToPoints(); them = other.X.ToPoints(); if (me.Equals(them)) { me = this.Y.ToPoints(); them = other.Y.ToPoints(); } } return(me.CompareTo(them)); }
public int CompareTo(PDFSize other) { PDFUnit me = this.Width.ToPoints() + this.Height.ToPoints(); PDFUnit them = other.Width.ToPoints() + other.Height.ToPoints(); if (me.Equals(them)) { me = this.Width.ToPoints(); them = other.Width.ToPoints(); if (me.Equals(them)) { me = this.Height.ToPoints(); them = other.Height.ToPoints(); } } return(me.CompareTo(them)); }