/// <summary>
 /// Check if Device connected to WiFi, if not pop up message box to mention how to connect
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void WiFiButton_Click(object sender, EventArgs e)
 {
     if (SetupAction.DetectWiFiConnection(WiFiButton, DeviceName, DeviceSN, Logger))
     {
         MessageBox.Show(ConnectedToWIFIMessage, ConnectedToWIFIMessage);
     }
     else
     {
         if (DeviceName == URbetter)
         {
             // maybe user need update the wpa_supplicant.conf file, push it in and run other two commands to connect to wifi
             SetupAction.UpdateWPASupplicant(Logger);
             DialogResult result = MessageBox.Show(URbetterConnectToWIFIStepsMessage, HowToConnectToWIFIMessage, MessageBoxButtons.OK);
             if (result == DialogResult.OK)
             {
                 SetupAction.PushNewWPASupplicant(DeviceSN, Logger);
             }
         }
         else if (DeviceName == DDK2)
         {
             MessageBox.Show(WIFIMessage_DDK2, HowToConnectToWIFIMessage);
         }
         else if (DeviceName == DDK1)
         {
             MessageBox.Show(WIFIMessage_DDK1, HowToConnectToWIFIMessage);
         }
         else if (DeviceName == Eden_Win)
         {
             MessageBox.Show(WIFIMessage_Eden, HowToConnectToWIFIMessage);
         }
     }
 }
 /// <summary>
 /// setup the device with compiled sample app and libs
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SetupButton_Click(object sender, EventArgs e)
 {
     if (DeviceName == DDK2)
     {
         SetupAction.Deploy(SetupButton, "all", DeviceSN, DeviceName, "arm64", Logger);
     }
     else if (DeviceName == URbetter)
     {
         SetupAction.Deploy(SetupButton, "all", DeviceSN, DeviceName, "arm64_U", Logger);
     }
     else if (DeviceName == DDK1)
     {
         SetupAction.Deploy(SetupButton, "all", DeviceSN, DeviceName, "arm", Logger);
     }
 }
        public Form1()
        {
            InitializeComponent();
            continueRichTextBox.Text          = InitalMessage;
            continueRichTextBox.HideSelection = false;
            // Define the border style of the form to a dialog box.
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            // Set the MaximizeBox to false to remove the maximize box.
            this.MaximizeBox = false;
            // Set the start position of the form to the center of the screen.
            this.StartPosition = FormStartPosition.CenterScreen;
            // add shortcut for F1
            this.KeyPreview = true;
            this.KeyDown   += new KeyEventHandler(Form1_KeyDown);
            // add richtext box right click
            this.continueRichTextBox.AddContextMenu();

            // read Device SN from app.config
            ReadSNFromConfig();

            // config log
            ConfigLog();

            // check if user has ADB command
            SetupAction.SanityCheckADB(Logger);

            // generate random port between 10000 - 11000
            Random r = new Random();

            PortNum = r.Next(10000, 11000);

            // get host PC IPV4 address
            IPAddressTextBox.Text = SetupAction.GetUsingIPV4() + ":" + PortNum.ToString();
            IPAddressV4_Local     = IPAddressTextBox.Text;

            // add different color for person and Guest in CTS
            // if you added a person's voice signature in config.json file, you can update GUEST to Person_Name | GUEST
            RegExp = new Regex(GUEST, RegexOptions.Compiled | RegexOptions.RightToLeft);

            Logger.Info("Form was launched.");
        }