예제 #1
0
        public string Add(MessageLevelType level, string text)
        {
            var message = new TypedMessage(level, text);

            Add(message);
            return(text);
        }
예제 #2
0
 /// <summary>
 /// Converts the <paramref name="sourceValue" /> parameter to the <paramref name="destinationType" /> parameter using <paramref
 /// name="formatProvider" /> and <paramref name="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="MessageLevelType" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MessageLevelType.CreateFrom(sourceValue);
예제 #3
0
 private IEnumerable <string> GetFilteredMessages(MessageLevelType type)
 {
     return(AllMessages.Where(x => x.Level == type).Select(x => x.Text));
 }
예제 #4
0
 public TypedMessage(MessageLevelType level, string text)
 {
     Level      = level;
     Text       = text;
     CreateTime = new DateTime();
 }