private void resetProfiler() { // Close printRuleViewer if it is still open printRuleViewer?.Close(); // reset everything model = null; Model.MarkerLiteral.Cause = null; //The cause may be a term in the old model, preventing the GC from freeing some resources untill a new cause is set in the new model z3AxiomTree.Nodes.Clear(); toolTipBox.Clear(); printRuleDict = new PrintRuleDictionary(); expanded.Clear(); searchTree = null; currentInfoPanelPrintable = null; // clear history historyNode.Nodes.Clear(); dagView.Clear(); //The dagView keeps references to the instances represented by visible nodes. Clearing it allows these resources to be freed. /* The entire model can be garbage collected now. Most of it will have aged into generation 2 of the garbage collection algorithm by now * which might take a while (~10s) until it is executed regularly. Giving the hint is, therefore, a good idea. */ GC.Collect(2, GCCollectionMode.Optimized); }
public EditPrintRuleDialog(PrintRuleDictionary printRuleDictionary, string match, PrintRule editRule) : this(printRuleDictionary) { editMode = true; // text matchTextBox.Text = match; prefixTextBox.Text = editRule.prefix(false); infixTextBox.Text = editRule.infix(false); suffixTextBox.Text = editRule.suffix(false); // colors colorButton.BackColor = editRule.color; // comboboxes // correct index for missing options prefixLinebreakCB.SelectedIndex = editRule.prefixLineBreak == PrintRule.LineBreakSetting.After ? 0 : 1; infixLinebreakCB.SelectedIndex = (int)editRule.infixLineBreak; // correct index for missing options suffixLinebreakCB.SelectedIndex = editRule.suffixLineBreak == PrintRule.LineBreakSetting.Before ? 0 : 1; parenthesesCB.SelectedIndex = (int)editRule.parentheses; // checkboxes printChildrenCB.Checked = editRule.printChildren; associativeCB.Checked = editRule.associative; // nummeric updowns precedenceUD.Value = editRule.precedence; }
public PrintRuleViewer(AxiomProfiler profiler, PrintRuleDictionary rulesDictionary) { this.profiler = profiler; printRuleDict = rulesDictionary; InitializeComponent(); updateRulesList(); }
public EditPrintRuleDialog(PrintRuleDictionary printRuleDictionary) { InitializeComponent(); this.printRuleDictionary = printRuleDictionary; prefixLinebreakCB.SelectedIndex = (int)PrintRule.LineBreakSetting.After; infixLinebreakCB.SelectedIndex = (int)PrintRule.LineBreakSetting.After; suffixLinebreakCB.SelectedIndex = (int)PrintRule.LineBreakSetting.Before; parenthesesCB.SelectedIndex = (int)PrintRule.ParenthesesSetting.Precedence; }