Ejemplo n.º 1
0
 private void txtNodeType_LostFocus(object sender, RoutedEventArgs e)
 {
     if (gui is RuleDisplay)
     {
         foreach (node n in nodes)
         {
             ((ruleNode)n).TargetType = txtNodeType.Text;
         }
     }
     else
     {
         var newType = Type.GetType(txtNodeType.Text);
         if (newType == null)
         {
             newType = Type.GetType("GraphSynth." + txtNodeType.Text);
         }
         if (newType == null)
         {
             newType = Type.GetType("GraphSynth.Representation." + txtNodeType.Text);
         }
         if (newType == null)
         {
             txtNodeType.Text = "";
             return;
         }
         foreach (node n in nodes)
         {
             /* make sure node is of right type - if not call the replacement function */
             if (newType.IsInstanceOfType(n))
             {
                 graph.replaceNodeWithInheritedType(n, newType);
             }
         }
     }
     Update();
 }