Ejemplo n.º 1
0
        protected override void OnExecute(string commandLine)
        {
            CommandResultInfo result = _pluginManager.ExecuteCommand(_pluginManager.ParseCommand(_channel, commandLine));

            if (result != null && result.Result == CommandResult.Fail)
            {
                ChatLines.Add(new ErrorMessageViewModel(DateTime.Now, result.Message));
                //TODO: Log
            }
        }
Ejemplo n.º 2
0
        private void Server_ErrorMessageRecieved(object sender, ErrorMessageEventArgs e)
        {
            if (e.Code == ReplyCode.ERR_NOMOTD)
            {
                Debug.WriteLine("Message ignored: " + e.Code);
                return;
            }

            ChatLines.Add(new IrcErrorViewModel(DateTime.Now, e.Message, e.Code.ToString()));
        }
Ejemplo n.º 3
0
 public ServerViewModel()
 {
     System.Windows.DependencyObject dep = new System.Windows.DependencyObject();
     if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(dep))
     {
         ChatLines.Add(new ChatItemViewModel(DateTime.Now, "Foo"));
         ChatLines.Add(new ChannelMessageViewModel(DateTime.Now, "Message", "Ortzinator"));
         ChatLines.Add(new ChannelActionViewModel(DateTime.Now, "puts a donk on it", "Ortzinator"));
         ChatLines.Add(new IrcErrorViewModel(DateTime.Now, "Something bad happened", "14859"));
         ChatLines.Add(new PrivateNoticeViewModel(DateTime.Now, "A notice for you", "aUser"));
         Name = "irc.foo.com";
         return;
     }
 }
Ejemplo n.º 4
0
        public void AddLine(string playerToken, string text)
        {
            var player = Players.FirstOrDefault(x => x.PlayerToken == playerToken);

            if (player == null)
            {
                throw new ArgumentException("Given player is not in the given chat");
            }
            _chatLines = ++_chatLines;
            ChatLines.Add(new ChatLine(player, text)
            {
                Tick = _chatLines
            });
            LastUse = DateTime.Now;
        }
Ejemplo n.º 5
0
 protected virtual void OnExecute(string commandLine)
 {
     ChatLines.Add(new ChatItemViewModel(DateTime.Now, commandLine));
 }
Ejemplo n.º 6
0
 private void Channel_MessagedChannel(object sender, UserMessageEventArgs e)
 {
     ChatLines.Add(new ChannelMessageViewModel(DateTime.Now, e.Message, e.User));
 }
Ejemplo n.º 7
0
 private void AddMessage(string msg)
 {
     ChatLines.Add(new ChatItemViewModel(DateTime.Now, msg));
 }
Ejemplo n.º 8
0
 private void Server_PrivateNotice(object sender, UserMessageEventArgs e)
 {
     ChatLines.Add(new PrivateNoticeViewModel(DateTime.Now, e.Message, e.User.Nick));
 }