示例#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
            }
        }
示例#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()));
        }
示例#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;
     }
 }
        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;
        }
示例#5
0
 protected virtual void OnExecute(string commandLine)
 {
     ChatLines.Add(new ChatItemViewModel(DateTime.Now, commandLine));
 }
示例#6
0
 private void Channel_MessagedChannel(object sender, UserMessageEventArgs e)
 {
     ChatLines.Add(new ChannelMessageViewModel(DateTime.Now, e.Message, e.User));
 }
示例#7
0
 private void AddMessage(string msg)
 {
     ChatLines.Add(new ChatItemViewModel(DateTime.Now, msg));
 }
示例#8
0
 private void Server_PrivateNotice(object sender, UserMessageEventArgs e)
 {
     ChatLines.Add(new PrivateNoticeViewModel(DateTime.Now, e.Message, e.User.Nick));
 }