예제 #1
0
 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;
     }
 }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public void RaiseError(MessageLocation location, MessageTemplate message, params object[] parameters)
 {
     Error = true;
     Messenger.Add(location, message, parameters);
 }