public static void AddMessage(this TempDataDictionary tempData, Message message) { dynamic messenger; if (tempData.TryGetValue(Messenger.Name, out messenger)) messenger.Add(message); else { messenger = new Messenger(); messenger.Add(message); tempData[Messenger.Name] = messenger; } }
public static void AddMessage(this TempDataDictionary tempData, MessageType type, string title, string body) { var message = new Message(type, title, body); dynamic messenger; if (tempData.TryGetValue(Messenger.Name, out messenger)) messenger.Add(message); else { messenger = new Messenger(); messenger.Add(message); tempData[Messenger.Name] = messenger; } }
public void RaiseError(MessageLocation location, MessageTemplate message, params object[] parameters) { Error = true; Messenger.Add(location, message, parameters); }