Esempio n. 1
0
        /// <summary>
        /// Set up an unsubscribe message to the server.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UnsubscribeButton_Click(object sender, RoutedEventArgs e)
        {
            LogToTextBox("Attempting to send Unsubscribe message");

            Message m = new Message();
            m.mID = SubscribeIDTextBox.Text;
            m.mType = MessageType.Unsubscribe;

            SendInfo sendInfo;
            sendInfo.client = mClient;
            sendInfo.data = m.ToString();

            Thread t = new Thread(NewSendThread);
            t.Start(sendInfo);
        }
Esempio n. 2
0
        /// <summary>
        /// Called when the client wants to send a user defined message to the server.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            LogToTextBox("Attempting to send UserDefined message");

            Message m = new Message();
            m.mID = IDTextBox.Text;
            m.mType = MessageType.UserDefined;
            m.mValues.Add("Payload", PayloadTextBox.Text);

            SendInfo sendInfo;
            sendInfo.client = mClient;
            sendInfo.data = m.ToString();

            Thread t = new Thread(NewSendThread);
            t.Start(sendInfo);
        }