Example #1
0
        public void selectTool(string toolCodename)
        {
            if (this.currentTool != null)
            {
                this.currentTool.cleanup();
            }

            AbstractDialog.deregisterLayoutComponents(this.toolContentLayout);

            if ((this.currentTool = this.tools.Find(x => x.codename.Equals(toolCodename))) == null)
            {
                this.toolContentLayout.AddChildren(new DialogGUIBase[] { }); // empty
            }
            else
            {
                this.currentTool.precompute();
                this.toolContentLayout.AddChildren(this.currentTool.getContentComponents().ToArray());
            }

            AbstractDialog.registerLayoutComponents(this.toolContentLayout);
            scrollArea.Resize();
        }
        private void AbstractButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (!this.paretocalculator.stackEmpty())
                {
                    AbstractDialog  dialogBox    = new AbstractDialog(this.paretocalculator);
                    Nullable <bool> dialogResult = dialogBox.ShowDialog();

                    if (dialogResult == true)
                    {
                        string aq = (string)dialogBox.abstractCombo.SelectedItem;
                        this.paretocalculator.executeAbstract(aq);
                        this.UpdateStack();
                    }
                }
            }
            catch (ParetoCalculatorExceptionW exc)
            {
                this.ParetoCalculatorExceptionOccurred(exc);
                this.UpdateStack();
            }
        }