/// <summary> /// Does a top-level check to see if this styled item may be equivalent to another styled item. /// </summary> /// <param name="otherEntity">The other styled item.</param> /// <returns>False if they don't have the same handles, null otherwise.</returns> public override bool?MaybeEquivalentTo(IFCEntity otherEntity) { bool?maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity); if (maybeEquivalentTo.HasValue) { return(maybeEquivalentTo.Value); } if (!(otherEntity is IFCStyledItem)) { return(false); } IFCStyledItem other = otherEntity as IFCStyledItem; if (!IFCRoot.Equals(Item, other.Item)) { return(false); } if (!IFCRoot.Equals(Styles, other.Styles)) { return(false); } return(null); }
/// <summary> /// Check if two IFCEntity lists are equal. /// </summary> /// <param name="list1">The first list.</param> /// <param name="list2">The second list.</param> /// <returns>True if they are equal, false otherwise.</returns> /// <remarks>The is not intended to be an exhaustive check.</remarks> static public bool AreIFCEntityListsEquivalent <T>(IList <T> list1, IList <T> list2) where T : IFCEntity { int numItems = list1.Count; if (numItems != list2.Count) { return(false); } for (int ii = 0; ii < numItems; ii++) { if (!IFCRoot.Equals(list1[ii], list2[ii])) { return(false); } } return(true); }