using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace MyClient { public partial class Connect : Form { Doc doc = null; public Initvalues cv = null; public Connect(Doc d) { doc = d; cv = doc.iv; InitializeComponent(); } // end of Connect constructor private void Connect_Load(object sender, EventArgs e) { // This is required with Mono if (Doc.Mono()) { numPort.TextAlign = HorizontalAlignment.Left; numTimeOut.TextAlign = HorizontalAlignment.Left; } // endif linux tbxHost.Text = cv.host; tbxUser.Text = (cv.user != null) ? cv.user : ""; tbxPwd.Text = (cv.pwd != null) ? cv.pwd : ""; tbxDb.Text = (cv.db != null) ? cv.db : ""; numPort.Value = cv.port; lbProto.SelectedIndex = cv.protocol; cbxPool.Checked = cv.pooling; numTimeOut.Value = cv.timeout; } // end of Connect_Load private void btnConnect_Click(object sender, EventArgs e) { cv.host = (tbxHost.Text.Length > 0) ? tbxHost.Text : "localhost"; cv.user = (tbxUser.Text.Length > 0) ? tbxUser.Text : null; cv.pwd = (tbxPwd.Text.Length > 0) ? tbxPwd.Text : null; cv.db = (tbxDb.Text.Length > 0) ? tbxDb.Text : null; cv.port = (int)numPort.Value; cv.protocol = lbProto.SelectedIndex; cv.timeout = (int)numTimeOut.Value; cv.pooling = cbxPool.Checked; } // end of btnConnect_Click } // end of class Connect } // end of namespace MyClient