Esempio n. 1
0
        /// <summary>
        /// Toolbar > Attributes optimizer.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbAttributesOptimization_Click(object sender, EventArgs e)
        {
            if (m_attributesOptimizerWindow == null)
            {
                // Display the settings window
                using (var settingsForm = new AttributesOptimizationSettingsForm(m_plan))
                {
                    settingsForm.ShowDialog(this);

                    if (settingsForm.DialogResult == DialogResult.OK)
                    {
                        // Now displays the computation window
                        m_attributesOptimizerWindow             = settingsForm.OptimizationForm;
                        m_attributesOptimizerWindow.PlanEditor  = (tabControl.SelectedIndex == 0) ? planEditor : null;
                        m_attributesOptimizerWindow.FormClosed += (form, args) => m_attributesOptimizerWindow = null;
                        m_attributesOptimizerWindow.Show(this);
                    }
                }
            }
            else
            {
                // Bring the window to front
                m_attributesOptimizerWindow.Visible = true;
                m_attributesOptimizerWindow.BringToFront();
                m_attributesOptimizerWindow.PlanEditor = (tabControl.SelectedIndex == 0) ? planEditor : null;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Toolbar > Attributes optimizer.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbAttributesOptimization_Click(object sender, EventArgs e)
        {
            if (m_attributesOptimizerWindow == null)
            {
                // Display the settings window
                using (var settingsForm = new AttributesOptimizationSettingsForm(m_plan))
                {
                    settingsForm.ShowDialog(this);

                    if (settingsForm.DialogResult == DialogResult.OK)
                    {
                        // Now displays the computation window
                        m_attributesOptimizerWindow = settingsForm.OptimizationForm;
                        m_attributesOptimizerWindow.PlanEditor = (tabControl.SelectedIndex == 0) ? planEditor : null;
                        m_attributesOptimizerWindow.FormClosed += (form, args) => m_attributesOptimizerWindow = null;
                        m_attributesOptimizerWindow.Show(this);
                    }
                }
            }
            else
            {
                // Bring the window to front
                m_attributesOptimizerWindow.Visible = true;
                m_attributesOptimizerWindow.BringToFront();
                m_attributesOptimizerWindow.PlanEditor = (tabControl.SelectedIndex == 0) ? planEditor : null;
            }
        }