示例#1
0
 private void workbenchConnection_Clicked(object sender, EventArgs e)
 {
     try
     {
         if (_boundService.WorkbenchConnections.Count == 0)
         {
             MySqlWorkbench.LaunchSqlEditor(null);
         }
         else if (!_editorMenu.HasDropDownItems)
         {
             MySqlWorkbench.LaunchSqlEditor(_boundService.WorkbenchConnections[0].Name);
         }
         else
         {
             for (int x = 0; x < _editorMenu.DropDownItems.Count; x++)
             {
                 if (sender == _editorMenu.DropDownItems[x])
                 {
                     MySqlWorkbench.LaunchSqlEditor(_boundService.WorkbenchConnections[x].Name);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Program.MySqlNotifierErrorHandler(Resources.FailureToLaunchWorkbench, true, ex);
     }
 }
 /// <summary>
 /// Event delegate method fired when the <see cref="ConfigureMenuItem"/> menu itemText is clicked.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SqlEditorMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (BoundInstance.RelatedConnections.Count == 0)
         {
             MySqlWorkbench.LaunchSqlEditor(null);
         }
         else if (!SqlEditorMenuItem.HasDropDownItems)
         {
             MySqlWorkbench.LaunchSqlEditor(BoundInstance.WorkbenchConnection.Name);
         }
         else
         {
             for (int i = 0; i < SqlEditorMenuItem.DropDownItems.Count; i++)
             {
                 if (sender == SqlEditorMenuItem.DropDownItems[i])
                 {
                     MySqlWorkbench.LaunchSqlEditor(BoundInstance.RelatedConnections[i].Name);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Program.MySqlNotifierErrorHandler(Resources.FailureToLaunchWorkbench, true, ex);
     }
 }
        /// <summary>
        /// Event delegate method fired when the <see cref="ConfigureMenuItem"/> menu itemText is clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SqlEditorMenuItem_Click(object sender, EventArgs e)
        {
            if (!(sender is ToolStripMenuItem menuItem) ||
                (!(menuItem.Tag is MySqlWorkbenchConnection connection)))
            {
                return;
            }

            MySqlWorkbench.LaunchSqlEditor(connection.Name);
        }
示例#4
0
 /// <summary>
 /// Initializes settings for the <see cref="MySqlWorkbench"/>, <see cref="MySqlSourceTrace"/>, <see cref="MySqlWorkbenchPasswordVault"/> and <see cref="MySqlInstaller"/> classes.
 /// </summary>
 private static void InitializeStaticSettings()
 {
     MySqlWorkbench.ExternalApplicationName = AssemblyInfo.AssemblyTitle;
     MySqlWorkbenchPasswordVault.ApplicationPasswordVaultFilePath          = EnvironmentApplicationDataDirectory + PASSWORDS_VAULT_FILE_RELATIVE_PATH;
     MySqlWorkbench.ExternalConnections.CreateDefaultConnections           = !MySqlWorkbench.ConnectionsFileExists && MySqlWorkbench.Connections.Count == 0;
     MySqlWorkbench.ExternalApplicationsConnectionsFileRetryLoadOrRecreate = true;
     MySqlWorkbench.ExternalApplicationConnectionsFilePath = EnvironmentApplicationDataDirectory + CONNECTIONS_FILE_RELATIVE_PATH;
     MySqlWorkbench.LoadData();
     MySqlWorkbench.LoadServers();
     MySqlInstaller.InstallerLegacyDllPath = InstallLocation;
     MySqlInstaller.LoadData();
 }
示例#5
0
 private void configureInstanceItem_Click(object sender, EventArgs e)
 {
     try
     {
         MySqlWorkbenchServer server = MySqlWorkbench.Servers.FindByServiceName(_boundService.ServiceName);
         MySqlWorkbench.LaunchConfigure(server);
     }
     catch (Exception ex)
     {
         Program.MySqlNotifierErrorHandler(Resources.FailureToLaunchWorkbench, true, ex);
     }
 }
    /// <summary>
    /// Increases the width of the dialog in case the <see cref="AutomaticMigrationDelayLabel"/> gets too big.
    /// </summary>
    private void SetAutomaticMigrationDelayText()
    {
      SuspendLayout();
      AutomaticMigrationDelayValueLabel.Text = MySqlWorkbench.GetConnectionsMigrationDelayText(Program.Notifier.NextAutomaticConnectionsMigration, Settings.Default.WorkbenchMigrationSucceeded);
      MigrateWorkbenchConnectionsButton.Enabled = MigrateConnectionsButtonEnabled;
      Width = _initialWidth;
      var spacingDelta = AutomaticMigrationDelayValueLabel.Location.X + AutomaticMigrationDelayValueLabel.Size.Width + DIALOG_RIGHT_SPACING_TO_CONTROLS + (DIALOG_BORDER_WIDTH * 2) - Width;
      if (spacingDelta > 0)
      {
        Width += spacingDelta;
      }

      ResumeLayout();
    }
示例#7
0
 /// <summary>
 /// Initializes settings for the <see cref="MySqlWorkbench"/>, <see cref="MySqlWorkbenchPasswordVault"/> and <see cref="MySqlInstaller"/> classes.
 /// </summary>
 private static void InitializeStaticSettings()
 {
     AutoStyleableBaseForm.HandleDpiSizeConversions = true;
     MySqlWorkbench.ExternalApplicationName         = AssemblyInfo.AssemblyTitle;
     MySqlWorkbenchPasswordVault.ApplicationPasswordVaultFilePath = EnvironmentApplicationDataDirectory + PASSWORDS_VAULT_FILE_RELATIVE_PATH;
     MySqlWorkbench.ExternalConnections.CreateDefaultConnections  = !MySqlWorkbench.ConnectionsFileExists &&
                                                                    MySqlWorkbench.Connections.Count == 0;
     MySqlWorkbench.ExternalApplicationsConnectionsFileRetryLoadOrRecreate = true;
     MySqlWorkbench.ExternalApplicationConnectionsFilePath = EnvironmentApplicationDataDirectory + CONNECTIONS_FILE_RELATIVE_PATH;
     MySqlWorkbench.LoadData();
     MySqlInstaller.LoadData(true);
     PasswordDialog.ApplicationIcon = Resources.MySqlNotifierIcon;
     PasswordDialog.SecurityLogo    = Resources.NotifierSecurityImage;
 }
        /// <summary>
        /// Event delegate method fired when the <see cref="ConfigureMenuItem"/> menu itemText is clicked.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Event arguments.</param>
        private void ConfigureMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                MySqlWorkbenchServer server = null;
                if (MySqlWorkbench.Servers.Any(s => s.ConnectionId == BoundInstance.WorkbenchConnectionId))
                {
                    server = MySqlWorkbench.Servers.First(s => s.ConnectionId == BoundInstance.WorkbenchConnectionId);
                }

                MySqlWorkbench.LaunchConfigure(server);
            }
            catch (Exception ex)
            {
                Program.MySqlNotifierErrorHandler(Resources.FailureToLaunchWorkbench, true, ex);
            }
        }
        /// <summary>
        /// Event delegate method fired when the <see cref="ConfigureMenuItem"/> menu itemText is clicked.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Event arguments.</param>
        private void ConfigureMenuItem_Click(object sender, EventArgs e)
        {
            var server = BoundInstance.RelatedServers.FirstOrDefault();

            MySqlWorkbench.LaunchConfigure(server);
        }
示例#10
0
        private void configureInstanceItem_Click(object sender, EventArgs e)
        {
            var server = _boundService.WorkbenchServers.FirstOrDefault();

            MySqlWorkbench.LaunchConfigure(server);
        }
示例#11
0
 /// <summary>
 /// Icnreases the width of the dialog in case the <see cref="AutomaticMigrationDelayLabel"/> gets too big.
 /// </summary>
 private void SetAutomaticMigrationDelayText()
 {
     AutomaticMigrationDelayValueLabel.Text    = MySqlWorkbench.GetConnectionsMigrationDelayText(MySqlDataProviderPackage.Instance.NextAutomaticConnectionsMigration, Settings.Default.WorkbenchMigrationSucceeded);
     MigrateWorkbenchConnectionsButton.Enabled = MigrateConnectionsButtonEnabled;
 }
示例#12
0
 /// <summary>
 /// Event delegate method fired when the <see cref="ManageConnectionsHotLabel"/> label is clicked.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">Event arguments.</param>
 private void ManageConnectionsHotLabel_Click(object sender, EventArgs e)
 {
     MySqlWorkbench.OpenManageConnectionsDialog();
 }