public Chat CreateChat(string auctionId, string participant, IMessageListener messageListener)
 {
     CurrentChat = new Chat(auctionId, participant);
     CurrentChat.AddIMessageListener(messageListener);
     Chats.Add(CurrentChat);
     OnChatCreated(EventArgs.Empty);
     return CurrentChat;
 }
 public Chat CreateChat(string auctionId, IMessageListener messageListener)
 {
     CurrentChat = new Chat(auctionId, XMPPConnection.UserName);
     if (messageListener != null)
     {
         CurrentChat.AddIMessageListener(messageListener);
     }
     Chats.Add(CurrentChat);
     OnChatCreated(EventArgs.Empty);
     return CurrentChat;
 }
示例#3
0
        private void JoinAuction(XMPPConnection connection, string itemId)
        {
            string formattedAuctionId = AuctionId(itemId, connection);
            Chat   chat = connection.ChatManager.CreateChat(formattedAuctionId, null);

            const int BID_AMOUNT = 35;
            IAuction  auction    = new XMPPAuction(chat);

            chat.AddIMessageListener(
                new AuctionMessageTranslator(
                    connection.UserName,
                    new Domain.AuctionSniper(auction, new SniperStateDisplayer(this))));
            auction.Join();
        }
 private void ChatManager_ChatCreated(object sender, EventArgs e)
 {
     _currentChat = ((ChatManager)sender).CurrentChat;
     _currentChat.AddIMessageListener(_singleMessageListener);
     _singleMessageListener.ProcessMessage += MessageListenerProcessMessage;
 }