コード例 #1
0
ファイル: ExecMsg.cs プロジェクト: Khrove/LowPay
        /// <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
ファイル: ExecMsg.cs プロジェクト: Khrove/LowPay
        /// <summary>
        /// Compares two ExecMsgs for display sorting purposes.
        /// Messages with higher severity are first, then messages
        /// with lower MessageID's.  Finally, if multiple messages
        /// with the same ID are in the list, they are compared
        /// by the Message text, so they always appear in the same
        /// canonical order.
        /// </summary>
        public int CompareTo(object obj)
        {
            if ((obj == null) || !(obj is ExecMsg))
            {
                return(-1);
            }
            ExecMsg msg = (ExecMsg)obj;
            int     C   = -Severity.CompareTo(msg.Severity);

            if (C != 0)
            {
                return(C);
            }
            C = MessageID.CompareTo(msg.MessageID);
            if (C != 0)
            {
                return(C);
            }
            return(Message.CompareTo(msg.Message));
        }
コード例 #3
0
ファイル: ExecMsg.cs プロジェクト: Khrove/LowPay
 public ExecMsg(ExecMsgSeverity msgSeverity, ExecMsg msgOld)
 {
     MessageID = msgOld.MessageID;
     Severity  = msgSeverity;
     Message   = msgOld.Message;
 }