// AwakeFromNib handles the initial setup of the ChatList. It also adds the initial placeholder message.
        // Finally, it sets the send button to be disabled, because the server isn't connected yet, and it enters the
        // placeholder buffer size in the input field.
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            _chatListDataSource = new ChatListDataSource();
            ChatList.DataSource = _chatListDataSource;
            ChatList.Delegate   = new ChatListDelegate(_chatListDataSource);

            var noMessages = new Message(
                MessageType.Info,
                "system",
                "No messages yet",
                DateTime.Now);

            UI.AddMessage(noMessages, _chatListDataSource, ChatList);

            SendButton.Enabled            = false;
            EnteredBufferSize.StringValue = "1024";
            UpdateBufferButton.Enabled    = false;
        }
Beispiel #2
0
 public ChatListDelegate(ChatListDataSource dataSource)
 {
     _dataSource = dataSource;
 }