Пример #1
0
 /// <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;
 }
Пример #2
0
 /// <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;
 }
Пример #3
0
 /// <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;
 }
Пример #4
0
 /// <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);
 }
Пример #5
0
 /// <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);
 }
Пример #6
0
 public MessageEventArgs(Message message)
 {
     this.Message = message;
 }