コード例 #1
0
        //Send Text Data To The Selected Client
        #region private void TextBox_Input_Send_to_Client_KeyDown(object sender, KeyEventArgs e)
        private void TextBox_Input_Send_to_Client_KeyDown(object sender, KeyEventArgs e)
        {
            if (TextBox_Remote_Client_IP.Text == "")
            {
                MessageBox.Show("Error: Pleas Enter Client IP To Send it", "Error at RemoteEndPoint IP ", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (clientSendRequset.Client.Connected)
            {
                if ((e.KeyCode == Keys.Enter))
                {
                    clientSendRequset.Writer = new BinaryWriter(clientSendRequset.MynetworkStream);

                    //1
                    clientSendRequset.Writer.Write((byte)3);                       // 3 is falg That means : the Cleint Wants To Send  To  Selected Client By IP Address
                    //2
                    clientSendRequset.Writer.Write(TextBox_Remote_Client_IP.Text); // Very Important : Send IP Address of Client You Want To Send to it

                    //3 : Sending  Text Data
                    clientSendRequset.Writer.Write("client>>" + TextBox_Input_Send_to_Client.Text);

                    TextBox_Input.Clear();
                }
            }
            else
            {
                // MessageBox.Show("Client is Diconnected");
                TextBox_Input.Clear();
            }
        }
コード例 #2
0
        private void ButtonMatch_Click(object sender, RoutedEventArgs e)
        {
            _vm.Init(GetOptions());
            var match = _vm.Match();

            if (match?.Success ?? false)
            {
                TextBox_Input.Focus();
                TextBox_Input.Select(match.Index, match.Length);
            }
        }
コード例 #3
0
 public TextInputWindow(string label, bool multiline = false)
 {
     InitializeComponent();
     Title = "Enter Input";
     if (multiline)
     {
         //this.Height += 200;
         TextBox_Input.Height                  += 200;
         TextBox_Input.VerticalAlignment        = VerticalAlignment.Top;
         TextBox_Input.VerticalContentAlignment = VerticalAlignment.Top;
         TextBox_Input.TextWrapping             = TextWrapping.Wrap;
         TextBox_Input.AcceptsReturn            = true;
         TextBox_Input.AcceptsTab               = true;
         TextBox_Input.UpdateLayout();
         Panel.UpdateLayout();
     }
     Label_Input.Text = label;
 }
コード例 #4
0
        // State management
        private void SetType(DictionaryType type)
        {
            ClearOutput();
            ClearInput();
            switch (type)
            {
            // Array
            case DictionaryType.DemoImplementation:
                dictionary = new DemoImplementation();
                break;

            default:
                ShowMessage("Couldn't change type: Not implemented.");
                return;
            }

            ShowMessage("Changed type.");
            UpdateOutput();
            TextBox_Input.Focus();
        }
コード例 #5
0
        //Send Text Data To The Server
        #region private void TextBox_input_KeyDown(object sender, KeyEventArgs e)
        private void TextBox_input_KeyDown(object sender, KeyEventArgs e)
        {
            if (clientSendRequset.Client.Connected)
            {
                if ((e.KeyCode == Keys.Enter))
                {
                    clientSendRequset.Writer = new BinaryWriter(clientSendRequset.MynetworkStream);

                    clientSendRequset.Writer.Write((byte)0);                         // 0 is Flag that Represent that the Client Send text Data

                    clientSendRequset.Writer.Write("client>>" + TextBox_Input.Text); // Send Text Data

                    TextBox_Input.Clear();
                }
            }
            else
            {
                // MessageBox.Show("Client is Diconnected");
                TextBox_Input.Clear();
            }
        }
コード例 #6
0
 private void ButtonReset_Click(object sender, RoutedEventArgs e)
 {
     _vm.Reset();
     TextBox_Input.Select(0, 0);
 }
コード例 #7
0
 public MainWindow()
 {
     InitializeComponent();
     TextBox_Regex.Text = "(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]";
     TextBox_Input.Focus();
 }
コード例 #8
0
 private void ClearInput()
 {
     TextBox_Input.Clear();
     TextBox_Input.Focus();
 }