Example #1
0
        /// <summary>
        /// Does a top-level check to see if this entity may be equivalent to otherEntity.
        /// </summary>
        /// <param name="otherEntity">The other IFCEntity.</param>
        /// <returns>True if they are equivalent, false if they aren't, null if not enough information.</returns>
        /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types.  This is intended
        /// to be used by derived classes.</remarks>
        public override bool?MaybeEquivalentTo(IFCEntity otherEntity)
        {
            bool?maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity);

            if (maybeEquivalentTo.HasValue)
            {
                return(maybeEquivalentTo.Value);
            }

            if (!(otherEntity is IFCPresentationLayerAssignment))
            {
                return(false);
            }

            IFCPresentationLayerAssignment other = otherEntity as IFCPresentationLayerAssignment;

            if (!IFCNamingUtil.SafeStringsAreEqual(Name, other.Name))
            {
                return(false);
            }

            if (!IFCNamingUtil.SafeStringsAreEqual(Description, other.Description))
            {
                return(false);
            }

            if (!IFCEntity.AreIFCEntityListsEquivalent(AssignedItems, other.AssignedItems))
            {
                return(false);
            }

            if (!IFCNamingUtil.SafeStringsAreEqual(Identifier, other.Identifier))
            {
                return(false);
            }

            return(null);
        }
        /// <summary>
        /// Does a top-level check to see if this entity is equivalent to otherEntity.
        /// </summary>
        /// <param name="otherEntity">The other IFCEntity.</param>
        /// <returns>True if they are equivalent, false if they aren't, null if not enough information.</returns>
        /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types.  This is intended
        /// to be used by derived classes.</remarks>
        public override bool?MaybeEquivalentTo(IFCEntity otherEntity)
        {
            bool?maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity);

            if (maybeEquivalentTo.HasValue)
            {
                return(maybeEquivalentTo.Value);
            }

            if (!(otherEntity is IFCPresentationLayerWithStyle))
            {
                return(false);
            }

            IFCPresentationLayerWithStyle other = otherEntity as IFCPresentationLayerWithStyle;

            if (!IFCEntity.AreIFCEntityListsEquivalent(LayerStyles, other.LayerStyles))
            {
                return(false);
            }

            return(null);
        }