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