Exemplo n.º 1
0
 private void InputMessage_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SendMethod();
         InputMessage.Clear();
     }
 }
Exemplo n.º 2
0
        public void SendMethod(int senderId, int[] recipientId, string message)
        {
            message = message.Trim();

            if (message == "")
            {
                return;
            }
            else
            {
                if (ForAllCheck.Text == "Remove")
                {
                    _client.SendMessage(abonentCurrent.id, null, message);
                }
                else
                {
                    if (recipientId.Length == 0)
                    {
                        MessageBox.Show("Select a user to send a message");
                        return;
                    }
                    else
                    {
                        if (isSendingToAll(recipientId.Length))
                        {
                            _client.SendMessage(abonentCurrent.id, null, message);
                        }
                        else
                        {
                            _client.SendMessage(abonentCurrent.id, recipientId, message);
                        }
                    }
                }

                InputMessage.Clear();

                this.ActiveControl = InputMessage;
                ForAllCheck.Text   = "All";
            }

            if (recipientId.Length > 1)
            {
                foreach (var index in AbonentList.CheckedIndices)
                {
                    int tmpUserIndex = Convert.ToInt32(index.ToString());
                    AbonentList.SetItemCheckState(tmpUserIndex, CheckState.Unchecked);
                }
            }
            else
            {
            }
        }
Exemplo n.º 3
0
        private async void SendMess_Click(object sender, EventArgs e)
        {
            if (Connect_to_Brick)
            {
                string Mess = InputMessage.Text;
                await _brick.Send_text(Mess);

                InputMessage.Clear();
            }
            else
            {
                MessageBox.Show("Pls Type in port");
            }
        }
Exemplo n.º 4
0
 private void SendButtonPressed(object sender, EventArgs e)
 {
     if (isConnected == true)
     {
         if (comboBox1.SelectedIndex == 0)
         {
             Client.CreateMessage(InputMessage.Text, "server");
             InputMessage.Clear();
         }
         else if ((string)comboBox1.Items[comboBox1.SelectedIndex] != clientNickName)
         {
             Client.CreateMessage(InputMessage.Text, (string)comboBox1.Items[comboBox1.SelectedIndex]);
             InputMessage.Clear();
         }
     }
 }
Exemplo n.º 5
0
        private void ClearIntermediateResults()
        {
            // matrices
            OriginalState.Clear();
            OriginalStateDiffusion.Clear();
            AdditionResultState.Clear();
            AdditionResultStateDiffusion.Clear();
            LittleEndianState.Clear();
            LittleEndianStateDiffusion.Clear();
            // qr
            QRInput.Clear();
            QRInputDiffusion.Clear();
            QRStep.Clear();
            QRStepDiffusion.Clear();
            QROutput.Clear();
            QROutputDiffusion.Clear();

            InputMessage.Clear();
            Keystream.Clear();
            KeystreamDiffusion.Clear();
            Output.Clear();
            OutputDiffusion.Clear();
        }
Exemplo n.º 6
0
        private void SendMethod()
        {
            if (InputMessage.Text.Trim() == "")
            {
                return;
            }
            else
            {
                if (ForAllCheck.Checked)
                {
                    client.SendMessage(id, null, InputMessage.Text);
                    InputMessage.Clear();
                    this.ActiveControl = InputMessage;
                }
                else
                {
                    List <int> destination = new List <int>();

                    foreach (var index in AbonentList.CheckedIndices)
                    {
                        int    tmpUserIndex = Convert.ToInt32(index.ToString());
                        string selectedUser = AbonentList.Items[tmpUserIndex].ToString();
                        string tmpName      = selectedUser.Substring(0, selectedUser.IndexOf(":"));

                        destination.Add(GetId(tmpName, allAbonents));
                    }

                    client.SendMessage(id, destination.ToArray(), InputMessage.Text);
                }
            }

            foreach (var index in AbonentList.CheckedIndices)
            {
                int tmpUserIndex = Convert.ToInt32(index.ToString());
                AbonentList.SetItemCheckState(tmpUserIndex, CheckState.Unchecked);
            }
        }