Ejemplo n.º 1
0
        public void Initialize(Message rootMessage)
        {
            RootMessage = _messageFactory.MakeMessageViewModel(rootMessage);
            RootMessage.LoadSender();

            AllMessages.Add(RootMessage);

            SelfIsSender = _sessionService.LoggedInUser.Id == rootMessage.SenderId;
        }
Ejemplo n.º 2
0
        public void Message(MessageSeverity severity, int code, string message, params object[] args)
        {
            var    msg = new Message(severity, code, Region, message, args);
            string s   = msg.ToString();                // Ensure this does not throw an exception

            AllMessages.Add(msg);
            if (_logToConsole)
            {
                Console.WriteLine(s);
            }
        }
 public void GetMessages()
 {
     while (true)
     {
         if (ClientSocket.newMessage != null)
         {
             AllMessages.Add(ClientSocket.newMessage);
             ClientSocket.newMessage = null;
             Application.Current.Dispatcher.Invoke(new System.Action(() => UpdateView()));
         }
     }
 }
Ejemplo n.º 4
0
        public void Message(MessageSeverity severity, int code, string message, params object[] args)
        {
            var msg = new Message(severity, code, Region, message, args);

            foreach (var a in args)
            {
                try {
                    new BinaryFormatter().Serialize(new MemoryStream(), a);
                }
                catch (Exception) {
                    throw new Exception("Error serializing argument " + a);
                }
            }
            string s = msg.ToString();                  // Ensure this does not throw an exception

            AllMessages.Add(msg);
            if (_logToConsole)
            {
                Console.WriteLine(s);
            }
        }
Ejemplo n.º 5
0
 public void AddMessage(Message message)
 {
     AllMessages.Add(_messageFactory.MakeMessageViewModel(message));
 }
Ejemplo n.º 6
0
 public void Write(string message, Color color)
 {
     AllMessages.Add(new Message {
         Text = message, Color = color
     });
 }