Exemple #1
0
    public ExporterForm(PluginSettingsForm.PluginSettingsValues settings)
    {
        InitializeComponent();

        Components = new List <ComponentOccurrence>();

        oldConsole = Console.Out;

        newConsole = new TextboxWriter(logText);
        Console.SetOut(newConsole);

        label1.Text       = "";
        labelOverall.Text = "";

        buttonSaveLog.Enabled = false;
        buttonSaveLog.Visible = false;

        ExporterSettings = settings;

        FormClosed += delegate(object sender, FormClosedEventArgs e)
        {
            Console.SetOut(oldConsole);
            if (exporterProgressThread != null && exporterProgressThread.IsAlive)
            {
                exporterProgressThread.Abort();
            }
            if (exporterThread != null && exporterThread.IsAlive)
            {
                exporterThread.Abort();
            }
            Cleanup();
        };

        buttonStart.Click += delegate(object sender, EventArgs e)
        {
            if (!finished)
            {
                StartExporter();

                buttonStart.Enabled = false;
            }
            else
            {
                Close();
            }
        };

        System.Windows.Forms.Application.Idle += delegate(object sender, EventArgs e)
        {
            newConsole.printQueue();
        };

        Instance = this;
    }
Exemple #2
0
    /// <summary>
    /// Opens the <see cref="PluginSettingsForm"/> form
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void SettingsExporter_OnClick(object sender, System.EventArgs e)
    {
        try
        {
            //TODO: Implement Value saving and loading
            PluginSettingsForm eSettingsForm = new PluginSettingsForm();

            eSettingsForm.ShowDialog();

            //BXDSettings.Instance.AddSettingsObject("Plugin Settings", ExporterSettingsForm.values);
            PluginSettings = PluginSettingsForm.Values;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
            throw;
        }
    }