示例#1
0
        /// <summary>
        /// Checks whether the element equals to another elements
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        protected override bool EqualsInternal(ReticleElement other)
        {
            if (other is ReticlePath path)
            {
                if (!object.Equals(LineWidth, path.LineWidth) ||
                    !object.Equals(Color, path.Color) ||
                    !object.Equals(Fill, path.Fill))
                {
                    return(false);
                }

                if (Elements.Count != path.Elements.Count)
                {
                    return(false);
                }

                for (int i = 0; i < Elements.Count; i++)
                {
                    if (!object.Equals(Elements[i], path.Elements[i]))
                    {
                        return(false);
                    }
                }

                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Checks whether the element equals to another elements
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        protected override bool EqualsInternal(ReticleElement other)
        {
            if (other is ReticleLine line)
            {
                return(object.Equals(Start, line.Start) &&
                       object.Equals(End, line.End) &&
                       object.Equals(LineWidth, line.LineWidth) &&
                       object.Equals(Color, line.Color));
            }

            return(false);
        }
示例#3
0
        /// <summary>
        /// Checks whether the element equals to another elements
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        protected override bool EqualsInternal(ReticleElement other)
        {
            if (other is ReticleText text)
            {
                return(Equals(Position, text.Position) &&
                       Equals(TextHeight, text.TextHeight) &&
                       Equals(Text, text.Text) &&
                       Equals(Color, text.Color));
            }

            return(false);
        }
示例#4
0
        /// <summary>
        /// Checks whether the element equals to another elements
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        protected override bool EqualsInternal(ReticleElement other)
        {
            if (other is ReticleCircle circle)
            {
                return(Equals(Center, circle.Center) &&
                       Equals(Radius, circle.Radius) &&
                       Equals(LineWidth, circle.LineWidth) &&
                       Equals(Fill, circle.Fill) &&
                       Equals(Color, circle.Color));
            }

            return(false);
        }
示例#5
0
        /// <summary>
        /// Checks whether the element equals to another elements
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        protected override bool EqualsInternal(ReticleElement other)
        {
            if (other is ReticleRectangle rectangle)
            {
                return(Equals(TopLeft, rectangle.TopLeft) &&
                       Equals(Size, rectangle.Size) &&
                       Equals(LineWidth, rectangle.LineWidth) &&
                       Equals(Color, rectangle.Color) &&
                       Equals(Fill, rectangle.Fill));
            }

            return(false);
        }