public static bool ValidateLocalLoginParams(ref ToolTipComboBox comboBoxFilePath, ref TextBox textBoxConnection) { try { if ((comboBoxFilePath.Text.Trim().Equals(Helper.GetResourceString(Constants.COMBOBOX_DEFAULT_TEXT)) && textBoxConnection.Text.Trim().Equals(string.Empty)) || ((comboBoxFilePath.Text.Trim().Equals(string.Empty) && textBoxConnection.Text.Trim().Equals(string.Empty)))) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_SELECT_DATABASE), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); comboBoxFilePath.Focus(); return(false); } } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return(false); } return(true); }
/// <summary> /// Event to get tooltip of combobox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void comboboxRecentQueries_DropdownItemSelected(object sender, ToolTipComboBox.DropdownItemSelectedEventArgs e) { try { if (e.SelectedItem < 0 || e.Scrolled) recentQueriesToolTip.Hide(comboboxRecentQueries); else if (comboboxRecentQueries.SelectedIndex != 0) recentQueriesToolTip.Show(comboboxRecentQueries.Text, comboboxRecentQueries, e.Bounds.Location.X + Cursor.Size.Width, e.Bounds.Location.Y + Cursor.Size.Height); } catch (Exception ex) { LoggingHelper.HandleException(ex); } }
private void comboBoxFilePath_DropdownItemSelected(object sender, ToolTipComboBox.DropdownItemSelectedEventArgs e) { try { if (e.SelectedItem < 0 || e.Scrolled) toolTipForTextBox.Hide(comboBoxFilePath); else toolTipForTextBox.Show(comboBoxFilePath.Items[e.SelectedItem].ToString(), comboBoxFilePath, e.Bounds.Location.X + Cursor.Size.Width, e.Bounds.Location.Y + Cursor.Size.Height); } catch (Exception ex) { LoggingHelper.HandleException(ex); } }
public static bool ValidateRemoteLoginParams(ref ToolTipComboBox comboBoxFilePath, ref TextBox textBoxHost, ref TextBox textBoxPort, ref TextBox textBoxUserName, ref TextBox textBoxPassword) { try { if (comboBoxFilePath.Text.Trim().Equals(Helper.GetResourceString(Constants.COMBOBOX_DEFAULT_TEXT)) && textBoxHost.Text.Trim().Equals(string.Empty) && textBoxPort.Text.Trim().Equals(string.Empty) && textBoxUserName.Text.Trim().Equals(string.Empty) && textBoxPassword.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_SELECT_REMOTE_CONNECTION), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); comboBoxFilePath.Focus(); return(false); } if (textBoxHost.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_HOST), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxHost.Focus(); return(false); } if (textBoxPort.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_PORT), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxPort.Focus(); return(false); } if (textBoxUserName.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_USERNAME), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxUserName.Focus(); return(false); } if (textBoxPassword.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_PASSWORD), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxPassword.Focus(); return(false); } if (!(Convert.ToInt32(textBoxPort.Text.Trim()) >= 1 && Convert.ToInt32(textBoxPort.Text.Trim()) <= 65535)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_PORT_RANG), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxPort.Focus(); return(false); } } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return(false); } return(true); }
public static bool ValidateRemoteLoginParams(ref ToolTipComboBox comboBoxFilePath, ref TextBox textBoxHost, ref TextBox textBoxPort, ref TextBox textBoxUserName, ref TextBox textBoxPassword) { try { if (comboBoxFilePath.Text.Trim().Equals(Helper.GetResourceString(Constants.COMBOBOX_DEFAULT_TEXT)) && textBoxHost.Text.Trim().Equals(string.Empty) && textBoxPort.Text.Trim().Equals(string.Empty) && textBoxUserName.Text.Trim().Equals(string.Empty) && textBoxPassword.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_SELECT_REMOTE_CONNECTION), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); comboBoxFilePath.Focus(); return false; } if (textBoxHost.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_HOST), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxHost.Focus(); return false; } if (textBoxPort.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_PORT), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxPort.Focus(); return false; } if (textBoxUserName.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_USERNAME), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxUserName.Focus(); return false; } if (textBoxPassword.Text.Trim().Equals(string.Empty)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_ENTER_PASSWORD), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxPassword.Focus(); return false; } if (!(Convert.ToInt32(textBoxPort.Text.Trim()) >= 1 && Convert.ToInt32(textBoxPort.Text.Trim()) <= 65535)) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_PORT_RANG), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxPort.Focus(); return false; } } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return false; } return true; }
public static bool ValidateLocalLoginParams(ref ToolTipComboBox comboBoxFilePath, ref TextBox textBoxConnection) { try { if ((comboBoxFilePath.Text.Trim().Equals(Helper.GetResourceString(Constants.COMBOBOX_DEFAULT_TEXT)) && textBoxConnection.Text.Trim().Equals(string.Empty)) || ((comboBoxFilePath.Text.Trim().Equals(string.Empty) && textBoxConnection.Text.Trim().Equals(string.Empty)))) { MessageBox.Show(Helper.GetResourceString(Constants.VALIDATION_MSG_SELECT_DATABASE), Helper.GetResourceString(Constants.PRODUCT_CAPTION), MessageBoxButtons.OK, MessageBoxIcon.Information); comboBoxFilePath.Focus(); return false; } } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return false; } return true; }
public DropdownWindow(ToolTipComboBox parent) { mParent = parent; mItem = -1; }