GetChat() public method

public GetChat ( Smuxi.Engine.ChatModel chatModel ) : ChatView
chatModel Smuxi.Engine.ChatModel
return ChatView
Ejemplo n.º 1
0
        private void _AddMessageToChat(ChatModel chatModel, MessageModel msg)
        {
            ChatView chatView = _ChatViewManager.GetChat(chatModel);

            if (chatView == null)
            {
#if LOG4NET
                _Logger.Fatal(
                    String.Format(
                        "_AddMessageToChat(): " +
                        "_ChatViewManager.GetChat(chatModel) " +
                        "chatModel.Name: {0} returned null!",
                        chatModel.Name
                        )
                    );
#endif
                return;
            }

#if LOG4NET && MSG_DEBUG
            DateTime start, stop;
            start = DateTime.UtcNow;
#endif
            chatView.AddMessage(msg);
#if LOG4NET && MSG_DEBUG
            stop = DateTime.UtcNow;
            _Logger.Debug(
                String.Format(
                    "_AddMessageToChat(): chatView.AddMessage() took: {0:0.00} ms",
                    (stop - start).TotalMilliseconds
                    )
                );
#endif
        }
Ejemplo n.º 2
0
        private void _CommandHelp(CommandModel cd)
        {
            var chatView = ChatViewManager.GetChat(cd.Chat);
            var builder  = new MessageBuilder();

            // TRANSLATOR: this line is used as a label / category for a
            // list of commands below
            builder.AppendHeader(_("Frontend Commands"));
            chatView.AddMessage(builder.ToMessage());

            string[] help =
            {
                "window (number|channelname|queryname|close)",
                "sync",
                "sort",
                "clear",
                "echo data",
                "exec command",
                "detach",
                "list [search key]",
            };

            foreach (string line in help)
            {
                builder = new MessageBuilder();
                builder.AppendEventPrefix();
                builder.AppendText(line);
                chatView.AddMessage(builder.ToMessage());
            }
        }