public IConnection createByForm(IWin32Window aOwner) { Connection lConnection = new Connection(); using (var lSetupForm = new ConnectionSetupForm(lConnection, true)) { if (lSetupForm.ShowDialog(aOwner) == DialogResult.Cancel) { lConnection = null; } } return lConnection; }
private void MirrorTablesForm_Load(object sender, EventArgs e) { ConnectionSetupForm csf = new ConnectionSetupForm(); if (csf.ShowDialog() != DialogResult.OK) { Close(); return; } _fm = new FastMirror(csf.Server, csf.MainDatabase, csf.User, csf.Password, csf.Server, csf.MirrorDatabase, csf.User, csf.Password); try { _fm.Connect(); } catch (Exception ex) { MessageBox.Show("Failed to connect to MySQL server: " + ex); Close(); } }
private void TestForm_Load(object sender, EventArgs e) { try { ConnectionSetupForm csf = new ConnectionSetupForm(); if (csf.ShowDialog() == DialogResult.OK) { _mirror = new FastMirror(csf.Server, csf.MainDatabase, csf.User, csf.Password, csf.Server, csf.MirrorDatabase, csf.User, csf.Password); _mirror.Connect(); } else { Close(); return; } } catch (Exception ex) { MessageBox.Show("Failed to connect: " + ex); return; } }
public void setupByForm(IConnection aConnection, IWin32Window aOwner) { using (var lSetupForm = new ConnectionSetupForm((Connection)aConnection, false)) { lSetupForm.ShowDialog(aOwner); } }