/// <summary> /// Initializes a result code with a general result code and a specific result code. /// </summary> public ResultID(ResultID resultID, long code) { m_name = resultID.Name; if (code > Int32.MaxValue) { code = -(((long)UInt32.MaxValue) + 1 - code); } m_code = (int)code; }
/// <summary> /// Returns true if the target object is equal to the object. /// </summary> public override bool Equals(object target) { if (target != null && target.GetType() == typeof(ResultID)) { ResultID resultID = (ResultID)target; // compare by integer if both specify valid integers. if (resultID.Code != -1 && Code != -1) { return((resultID.Code == Code) && (resultID.Name == Name)); } // compare by name if both specify valid names. if (resultID.Name != null && Name != null) { return(resultID.Name == Name); } } return(false); }
/// <remarks/> public ResultIDException(ResultID result, string message, Exception e) : base(result.ToString() + "\r\n" + message, e) { m_result = result; }
/// <remarks/> public ResultIDException(ResultID result) : base(result.ToString()) { m_result = result; }