/// <summary> /// emit warning message with code /// </summary> /// <param name="code"></param> /// <param name="description"></param> /// <returns></returns> public static Message Warning(int code, string description) { Message message = new Message(MessageLevel.Warning, description); message.code = code; return message; }
/// <summary> /// emit information message with code /// </summary> /// <param name="code"></param> /// <param name="description"></param> /// <returns></returns> public static Message Information(int code, string description) { Message message = new Message(MessageLevel.Information, description); message.code = code; return message; }
/// <summary> /// emit error message with code /// </summary> /// <param name="code"></param> /// <param name="description"></param> /// <returns></returns> public static Message Error(int code, string description) { Message message = new Message(MessageLevel.Error, description); message.code = code; return message; }
/// <summary> /// construct Exception by message code /// </summary> /// <param name="code"></param> /// <param name="message"></param> public MessageException(MessageCode code, string message) : base(message) { this.msg = new Message(MessageLevel.Error, message) .HasCode((int)code); }
/// <summary> /// construct Exception by message and level /// </summary> /// <param name="level"></param> /// <param name="format"></param> /// <param name="args"></param> public MessageException(MessageLevel level, string format, params object[] args) : base(string.Format(format, args)) { this.msg = new Message(level, string.Format(format, args)) .HasCode((int)MessageCode.None); }
public MessageEventArgs(Message message) { this.Message = message; }