Example #1
0
        /// <summary>
        /// Performs a deep copy of the target <see cref="SeriesBranchBase"/> object.
        /// </summary>
        /// <returns>A deep copy of the target <see cref="SeriesBranchBase"/> object.</returns>
        public SeriesBranchBase Copy()
        {
            SeriesBranchBase copy = (SeriesBranchBase)this.MemberwiseClone();

            copy.RawImpedanceParameters = this.m_impedance.Copy();
            return(copy);
        }
Example #2
0
        /// <summary>
        /// Determines equality between to <see cref="SeriesBranchBase"/> objects
        /// </summary>
        /// <param name="target">The target object for equality testing.</param>
        /// <returns>A bool representing the result of the equality check.</returns>
        public override bool Equals(object target)
        {
            // If parameter is null return false.
            if (target == null)
            {
                return(false);
            }

            // If parameter cannot be cast to PhasorBase return false.
            SeriesBranchBase seriesBranchBase = target as SeriesBranchBase;

            if ((object)seriesBranchBase == null)
            {
                return(false);
            }

            // Return true if the fields match:
            if (this.m_internalID != seriesBranchBase.InternalID)
            {
                return(false);
            }
            else if (this.m_number != seriesBranchBase.Number)
            {
                return(false);
            }
            else if (this.m_name != seriesBranchBase.Name)
            {
                return(false);
            }
            else if (this.m_description != seriesBranchBase.Description)
            {
                return(false);
            }
            else if (!this.m_impedance.Equals(seriesBranchBase.RawImpedanceParameters))
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }