Exemplo n.º 1
0
 private void addPluginButton_Click(object sender, EventArgs e)
 {
     openFileDialog.InitialDirectory = Application.ExecutablePath;
     openFileDialog.FileName         = string.Empty;
     if (openFileDialog.ShowDialog(this) == DialogResult.OK)
     {
         try
         {
             foreach (string filename in openFileDialog.FileNames)
             {
                 FileInfo fileInfo = new FileInfo(filename);
                 manager.CheckForPlugin(fileInfo);
             }
             if (manager.Exceptions.Count > 0)
             {
                 ExceptionViewer problems = new ExceptionViewer(manager.Exceptions);
                 problems.ShowDialog(this);
                 manager.Exceptions.Clear();
             }
             UpdateList();
             manager.SaveSettings();
         }
         catch (Exception ex)
         {
             MessageBox.Show(this, ex.Message);
         }
     }
 }
Exemplo n.º 2
0
        private void form_close(object sender, FormClosingEventArgs e)
        {
            if (manager.CanStop)
            {
                manager.Stop();
            }

            // Alle Plugin-Einstellungen absichern
            Settings.Default.Save();
            manager.SaveSettings();

            // show possible problems
            if (manager.Exceptions != null && manager.Exceptions.Count > 0)
            {
                ExceptionViewer form = new ExceptionViewer(manager.Exceptions);
                manager.Exceptions.Clear();
                form.ShowDialog(this);
            }
        }