示例#1
0
        public void showProperties(Netron.GraphLib.UI.GraphControl GC, grammarRule rule1, object[] props)
        {
            graphControl = GC;
            rule         = rule1;

            if (graphControl.Name == "graphControlLHS")
            {
                graph = rule.L;
            }
            else
            {
                graph = rule.R;
            }

            rule.updateFromGraphControl(graphControl);
            try
            {
                this.graphRulePropsTab.Text = "Rule Properties";
                if (rule.Bag == null)
                {
                    rule.initPropertiesBag();
                }
                this.graphRuleProps.SelectedObject = rule.Bag;
            }
            catch (Exception exc)
            {
                MessageBox.Show("The properties of the rule has thrown an exception and cannot be displayed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                SearchIO.output(exc.Message, 2);
            }
            showDisplayProperties(graphControl, (Netron.GraphLib.PropertyBag)props[0]);
            showRuleNodeArcProperties((Netron.GraphLib.PropertyBag)props[0], graph);
        }
示例#2
0
        private void displayProps_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            if (rule != null)
            {
                rule.updateFromGraphControl(graphControl);
            }
            else
            {
                graph.updateFromGraphControl(graphControl);
            }

            /* after you update the nodes, arcs - you may need to re-update the display based
             * on changes there (e.g. new K elements) */
            Props_PropertyValueChanged(s, e);
        }