private void LoadDropDownValues() { dropDownValues = new ConnectionEditorForm.NamedArrayList[] { connectionStringLastValue = new ConnectionEditorForm.NamedArrayList("ConnectionStringLast"), serverDropDownValues = new ConnectionEditorForm.NamedArrayList("Server"), portDropDownValues = new ConnectionEditorForm.NamedArrayList("Port"), databaseDropDownValues = new ConnectionEditorForm.NamedArrayList("Database"), userDropDownValues = new ConnectionEditorForm.NamedArrayList("User"), groupDropDownValues = new ConnectionEditorForm.NamedArrayList("Group"), roleDropDownValues = new ConnectionEditorForm.NamedArrayList("Role") }; ConnectionEditorForm.LoadValuesFromApplicationDataFolder( // load from ConnectionEditor.xml dropDownValues, ConnectionEditorForm.ApplicationDataFileName); // this.comboServer.Text = ConnectionEditorForm.GetValueOfKeyword(nv, DrvConst.DRV_PROP_HOST); this.comboServer.Items.AddRange(serverDropDownValues.ToArray()); if (serverDropDownValues.IndexOf("(local)") == -1) { this.comboServer.Items.Add("(local)"); } // this.comboPort.Text = ConnectionEditorForm.GetValueOfKeyword(nv, DrvConst.DRV_PROP_PORT, "II7"); this.comboPort.Items.AddRange(portDropDownValues.ToArray()); // this.comboDatabase.Text = ConnectionEditorForm.GetValueOfKeyword(nv, DrvConst.DRV_PROP_DB); this.comboDatabase.Items.AddRange(databaseDropDownValues.ToArray()); // this.comboUser.Text = ConnectionEditorForm.GetValueOfKeyword(nv, DrvConst.DRV_PROP_USR); this.comboUser.Items.AddRange(userDropDownValues.ToArray()); } // LoadDropDownValues
private void SaveDropDownValues() { if (dropDownValues == null) { return; } ConnectionEditorForm.SaveValuesToApplicationDataFolder( dropDownValues, ConnectionEditorForm.ApplicationDataFileName); }
private void btnResetServerCache_Click(object sender, EventArgs e) { using (var rsc = new ConnectionEditorForm()) { if (rsc.ShowDialog(this.ParentForm, btnResetServerCache.RectangleToScreen(btnResetServerCache.Bounds)) == DialogResult.OK) { foreach (var conn in rsc.SelectedConnections) { var arasConn = conn.ArasLogin(); arasConn.Process(new Command("<Item/>").WithAction("ResetServerCache")); } } } }
private void btnEditConnection_Click(object sender, EventArgs e) { using (var dialog = new ConnectionEditorForm()) { dialog.Multiselect = false; if (_connData != null) { dialog.SetSelected(_connData); } if (dialog.ShowDialog(this, menuStrip.RectangleToScreen(btnEditConnection.Bounds)) == System.Windows.Forms.DialogResult.OK) { SetConnection(dialog.SelectedConnections.First()); } } }
private void btnResetServerCache_Click(object sender, EventArgs e) { string msg; using (var rsc = new ConnectionEditorForm()) { if (rsc.ShowDialog(this.ParentForm) == DialogResult.OK) { foreach (var conn in rsc.SelectedConnections) { var arasConn = ConnectionEditor.Login(conn, out msg); if (arasConn == null) { MessageBox.Show(msg); } else { arasConn.CallAction("ResetServerCache", "<Item/>"); } } } } }
private void btnEditConnection_Click(object sender, EventArgs e) { using (var dialog = new ConnectionEditorForm()) { dialog.Multiselect = false; if (_connData != null) dialog.SetSelected(_connData); if (dialog.ShowDialog(this, menuStrip.RectangleToScreen(btnEditConnection.Bounds)) == System.Windows.Forms.DialogResult.OK) { SetConnection(dialog.SelectedConnections.First()); } } }
private static ConnectionEditorForm.NamedArrayList UpdateDropDownList( ConnectionEditorForm.NamedArrayList array, string str) { return(ConnectionEditorForm.UpdateDropDownList(array, str)); }