Example #1
0
        private void txtArcType_LostFocus(object sender, RoutedEventArgs e)
        {
            var newType = Type.GetType(txtArcType.Text);

            if (newType == null)
            {
                newType = Type.GetType("GraphSynth." + txtArcType.Text);
            }
            if (newType == null)
            {
                newType = Type.GetType("GraphSynth.Representation." + txtArcType.Text);
            }
            if (newType == null)
            {
                txtArcType.Text = "";
                return;
            }
            if (gui is RuleDisplay)
            {
                foreach (arc a in arcs)
                {
                    ((ruleArc)a).TargetType = newType.ToString();
                }
            }
            else
            {
                foreach (arc a in arcs)
                {
                    /* make sure node is of right type - if not call the replacement function */
                    if (newType.IsInstanceOfType(a))
                    {
                        graph.replaceArcWithInheritedType(a, newType);
                    }
                }
            }
            Update();
        }