public void Update() { if (IsConntected) { string msg = messageService.PopRawMessage(); if (msg != string.Empty) { ADSBMessageBase parsedMessage = messageBuilder.BuildMessage(msg); if (parsedMessage == null) { return; } if (!Planes.ContainsKey(parsedMessage.ICAO)) { Planes.Add(parsedMessage.ICAO, new Plane(parsedMessage.ICAO)); } //Console.WriteLine(parsedMessage.ToString()); Planes[parsedMessage.ICAO].addMessageToPlane(parsedMessage); } } }
/// <summary> /// Processes the context. /// </summary> /// <param name="context">The context.</param> /// <param name="builder">The Message Builder</param> public void Process(IEmailContext context, IMessageBuilder builder) { var message = builder.BuildMessage(context, _repository); if (message != null) { _sender.Send(message); } }
/// <summary> /// Processes the context batch. /// </summary> /// <param name="batch">The batch.</param> /// <param name="builder">The Message Builder</param> public void ProcessBatch(IEnumerable<IEmailContext> batch, IMessageBuilder builder) { var messages = new List<MailMessage>(); foreach (var context in batch) { var message = builder.BuildMessage(context, _repository); if (message != null) { messages.Add(message); } } _sender.SendBatch(messages); }
public string CreateMessage(IIntegrationResult result) { // TODO Add culprit to message text -- especially if modifier is not an email user // This information is included, when using Html email (all mods are shown) try { return(messageBuilder.BuildMessage(result)); } catch (Exception e) { string message = "Unable to build email message: " + e; Log.Error(message); return(message); } }
public async Task <string> GetMessageAsync() { return(await _messageBuilder.BuildMessage()); }