public bool Equals(TextLayoutData other) { if (Width != other.Width || Height != other.Height || Text != other.Text || Font != other.Font || TextTrimming != other.TextTrimming || WrapMode != other.WrapMode) { return(false); } if (Attributes == null && other.Attributes == null) { return(true); } if (Attributes != null || other.Attributes != null) { return(false); } if (Attributes.Count != other.Attributes.Count) { return(false); } for (int n = 0; n < Attributes.Count; n++) { if (!Attributes [n].Equals(other.Attributes [n])) { return(false); } } return(true); }
public void AddTextLayout(TextLayoutData td) { var found = TextLayouts.FirstOrDefault(t => t.Equals(td)) ?? td; TextLayouts.Add(found); }
public bool Equals(TextLayoutData other) { if (Width != other.Width || Height != other.Height || Text != other.Text || Font != other.Font || TextTrimming != other.TextTrimming) return false; if (Attributes == null && other.Attributes == null) return true; if (Attributes != null || other.Attributes != null) return false; if (Attributes.Count != other.Attributes.Count) return false; for (int n=0; n<Attributes.Count; n++) if (!Attributes [n].Equals (other.Attributes [n])) return false; return true; }
public void AddTextLayout(TextLayoutData td) { var found = TextLayouts.FirstOrDefault (t => t.Equals (td)) ?? td; TextLayouts.Add (found); }