Пример #1
0
        /// <summary>
        /// Determines if two messages are the equal.  They are considered
        /// equal if they have the same Severity, MessageID, and Message text.
        /// </summary>
        public override bool Equals(object obj)
        {
            if ((obj == null) || !(obj is ExecMsg))
            {
                return(false);
            }
            ExecMsg msg = (ExecMsg)obj;

            return(Severity.Equals(msg.Severity) && MessageID.Equals(msg.MessageID) && Message.Equals(msg.Message));
        }
Пример #2
0
        /// <summary>
        /// Returns true if Metric instances are equal
        /// </summary>
        /// <param name="other">Instance of Metric to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Metric other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Severity == other.Severity ||

                     Severity.Equals(other.Severity)
                 ) &&
                 (
                     Passed == other.Passed ||

                     Passed.Equals(other.Passed)
                 ) &&
                 (
                     Override == other.Override ||

                     Override.Equals(other.Override)
                 ) &&
                 (
                     ActualValue == other.ActualValue ||
                     ActualValue != null &&
                     ActualValue.Equals(other.ActualValue)
                 ) &&
                 (
                     ExpectedValue == other.ExpectedValue ||
                     ExpectedValue != null &&
                     ExpectedValue.Equals(other.ExpectedValue)
                 ) &&
                 (
                     Comparator == other.Comparator ||

                     Comparator.Equals(other.Comparator)
                 ) &&
                 (
                     Kpi == other.Kpi ||
                     Kpi != null &&
                     Kpi.Equals(other.Kpi)
                 ));
        }
Пример #3
0
        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Severity ps = (Severity)int.Parse(parameter.ToString());

            return(ps.Equals(value) ? Visibility.Visible : Visibility.Hidden);
        }