Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Logging.Models.LoggingModel"/> class.
 /// </summary>
 /// <param name="origin">Origin.</param>
 /// <param name="message">Message.</param>
 /// <param name="type">Type.</param>
 public LoggingBlockModel(string origin, string message, LoggingBlockType type = LoggingBlockType.Warning)
 {
     Id          = Guid.NewGuid().ToString();
     TimeStamp   = DateTime.Now;
     BlockOrigin = origin;
     Message     = message;
     Type        = type;
 }
        public LoggingBlockModel AddLog(string origin, string message, LoggingBlockType type)
        {
            var model = new LoggingBlockModel(origin, message, type);

            if (!model.IsValid())
            {
                return(model);
            }

            var command = new AddLoggingCommand(model);

            command.Run();
            return(model);
        }
        public IEnumerable <LoggingBlockModel> ListAllLoggingFromType(string blockName, LoggingBlockType type)
        {
            if (string.IsNullOrEmpty(blockName))
            {
                return(Enumerable.Empty <LoggingBlockModel>());
            }

            return(new ListAllLoggingFromTypeQuery(blockName, type).Run());
        }
 public ListLoggingFromBlockNameAndTypeQuery(string blockName, LoggingBlockType type)
 {
     _blockName = blockName;
     _type      = type;
 }
Beispiel #5
0
 public TestListAllLoggingFromTypeQuery(string blockName, LoggingBlockType loggingType) : base(blockName, loggingType)
 {
 }