public frmSettings()
 {
     InitializeComponent();
     txtChanged = new EventHandler(this.Text_Changed);
     addEventHandlers_TextBoxes(this);
     cBoxDevicePort.Items.AddRange(Texting.GetPorts());
     if (Settings.Default.portName.Equals("None"))
     {
         btnQueryDevice.Enabled = false;
     }
 }
        private void sendMessage(object oListPayload)
        {
            Texting t = new Texting();
            List <MessagePayload> listPayload = (List <MessagePayload>)oListPayload;

            t.openPort();
            foreach (MessagePayload payload in listPayload)
            {
                t.sendMessage(payload.number, payload.message);
            }
            t.closePort();
        }
 private void btnQueryDevice_Click(object sender, EventArgs e)
 {
     Texting.QueryDevice(cBoxDevicePort.SelectedItem.ToString());
 }
 private void sendMessage(object oListPayload)
 {
     Texting t = new Texting();
     List<MessagePayload> listPayload = (List < MessagePayload >)oListPayload;
     t.openPort();
     foreach (MessagePayload payload in listPayload)
     {
         t.sendMessage(payload.number, payload.message);
     }
     t.closePort();
 }