Ejemplo n.º 1
0
        public FormRegister(ActiveMQClient client)
        {
            Client = client;

            Client.RegisterUserResponse += Client_RegisterUserResponse;

            InitializeComponent();
        }
Ejemplo n.º 2
0
 public FormSearch(ActiveMQClient Client, string UserName, List <User> MyFriends)
 {
     InitializeComponent();
     this.Client    = Client;
     this.UserName  = UserName;
     this.MyFriends = MyFriends;
     Client.FriendsSearchedResponse += Client_FriendsSearchedResponse;
 }
Ejemplo n.º 3
0
 public FormModify(string UserName, ActiveMQClient Client)
 {
     InitializeComponent();
     this.UserName = UserName;
     this.Client   = Client;
     Client.GetUserInfoResponse    += Client_GetUserInfoResponse;
     Client.UpdateUserInfoResponse += Client_UpdateUserInfoResponse;
     Client.GetUserInfo(UserName);
 }
Ejemplo n.º 4
0
 // 当前用户,好友NickName,好友Address
 public FormChat(string CurrentUser, string FriendUserName, string FriendNickName, string FriendAddress, ActiveMQClient Client)
 {
     this.CurrentUser    = CurrentUser;
     this.FriendUserName = FriendUserName;
     this.FriendNickName = FriendNickName;
     InitializeComponent();
     this.Text = "正在和" + FriendNickName + "聊天";
     //activeMQ.Connect("MyChat");
     //activeMQ.Received += ActiveMQ_Received;
     this.FriendAddress = FriendAddress;
     this.Client        = Client;
 }
Ejemplo n.º 5
0
        //private void WorkItemsProducer()
        //{
        //    mqArray = new MessageQueue[(int)nudThreads.Value];
        //    for (int i = 0; i < nudThreads.Value; i++)
        //    {
        //        mqArray[i] = new MessageQueue();
        //        stp.QueueWorkItem(Dequeue, mqArray[i]);
        //    }
        //    stp.WaitForIdle();
        //    stp.Shutdown();
        //}

        private void MessageProducer()
        {
            try
            {
                if (MQClient == null)
                {
                    MQClient = new ActiveMQClient(messageConfig.QueueName, (int)nudThreads.Value);
                }
                MQClient.Start();
                MQClient.Dequeue(consumer_Listener);
            }
            catch (Exception e)
            {
                this.BeginInvoke(new MethodInvoker(delegate
                {
                    txtLogInfo.AppendText(e.ToString());
                    UpdateControls(false);
                }));
            }
        }
Ejemplo n.º 6
0
 public void ConnectTest()
 {
     ActiveMQClient client = new ActiveMQClient();
     // client.Connect();
 }