public static void AddElement(ElementC element) { elements.Add(element); if (ElementAdded != null) { ElementAdded(null, EventArgs.Empty); } }
public static void AddElement(ElementC element) { elements.Add(element); if (ElementAdded != null) { ElementAdded(null, EventArgs.Empty); } }
private void MyTreeViewControl_ElementAdded(object sender, EventArgs e) { ElementC element = MyTreeViewControlC.GetLastElement(); if (null != element) { tvw_treeview.SelectedNode = element; tvw_treeview.Select(); } }
private void btn_addparam_Click(object sender, EventArgs e) { ParamElementC param = new ParamElementC(); param.ElementName = "param"; param.ElementValue = "tbd"; param.AttributeType = ContextC.Instance.GetParamTypes()[0]; param.Text = param.ElementName + " - " + param.ElementValue; element.children.Add(param); element.Nodes.Add(param); MyTreeViewControlC.AddElement(param); element = null; }
private void btn_addparam_Click(object sender, EventArgs e) { ParamElementC param = new ParamElementC(); param.ElementName = "param"; param.ElementValue = "tbd"; param.AttributeType = ContextC.Instance.GetParamTypes()[0]; param.Text = param.ElementName + " - " + param.ElementValue; element.children.Add(param); element.Nodes.Add(param); MyTreeViewControlC.AddElement(param); element = null; }
private List<string> PopulateStringList(ElementC element) { List<string> retValue = new List<string>(); foreach ( ElementC c in element.children ) { if ("class" == c.ElementName) { ClassElementC param = (ClassElementC)c; retValue.Add(param.GetCompleteName()); } if (c.children.Count > 0) { retValue.AddRange(PopulateStringList(c)); } } return retValue; }
private List <string> PopulateStringList(ElementC element) { List <string> retValue = new List <string>(); foreach (ElementC c in element.children) { if ("class" == c.ElementName) { ClassElementC param = (ClassElementC)c; retValue.Add(param.GetCompleteName()); } if (c.children.Count > 0) { retValue.AddRange(PopulateStringList(c)); } } return(retValue); }
private void tvw_treeview_AfterSelect(object sender, TreeViewEventArgs e) { ElementC temp = (ElementC)tvw_treeview.SelectedNode; DisableUserControls(); switch (temp.ElementName) { case "classes": { uc_classes.SetSelectedElement(temp); uc_classes.Visible = true; break; } case "class": { uc_class.SetElement((ClassElementC)temp); uc_class.Visible = true; break; } case "constructor": { uc_constructor.SetElement(temp); uc_constructor.Visible = true; break; } case "param": { uc_param.SetElement((ParamElementC)temp); uc_param.Visible = true; break; } default: { uc_default.AssignElement(temp); uc_default.Visible = true; break; } } }
private void MyTreeViewControl_ElementUpdated(object sender, EventArgs e) { ElementC temp = (ElementC)tvw_treeview.SelectedNode; switch (temp.ElementName) { case "class": { uc_class.SetElement((ClassElementC)temp); break; } case "objectname": { uc_default.Visible = false; uc_default.AssignElement(temp); uc_default.Visible = true; break; } case "constructor": { uc_constructor.SetElement(temp); uc_constructor.Visible = true; break; } case "param": { uc_param.SetElement((ParamElementC)temp); uc_param.Visible = true; break; } default: { break; } } tvw_treeview.Focus(); }
private void cbx_classkey_CheckedChanged(object sender, EventArgs e) { if (true == cbx_classkey.Checked) { ElementC parent = (ElementC)Element.Parent; foreach (ElementC child in parent.children) { ParamElementC cast = (ParamElementC)child; if (null != cast.ClassKeyType && "yes" == cast.ClassKeyType && Element.ElementValue != cast.ElementValue) { cast.ClassKeyType = null; MyLoggerC.Log("Moved classkey from parameter \"" + cast.ElementValue + "\" to parameter \"" + Element.ElementValue + "\"." + Environment.NewLine); } } Element.ClassKeyType = "yes"; cbx_classkey.Enabled = false; } else { Element.ClassKeyType = null; } }
virtual public bool Parse(XmlNode node) { bool retValue = true; ElementName = node.Name; if (null != node.FirstChild && XmlNodeType.Text == node.FirstChild.NodeType) { ElementValue = node.InnerText; } else { ElementValue = null; } if (null != node.Attributes) { foreach (XmlAttribute attribute in node.Attributes) { AttributeC attrib = new AttributeC(); attrib.Name = attribute.Name; attrib.Value = attribute.Value; attributes.Add(attrib); } } if (null != node.FirstChild && XmlNodeType.Element == node.FirstChild.NodeType) { foreach (XmlNode childNode in node.ChildNodes) { if (true == retValue) { ElementC child = ElementFactoryC.GetElement(childNode.Name); retValue = child.Parse(childNode); children.Add(child); } } } return(retValue); }
public void SetElement(ElementC element) { Element = element; EnableButtons(); }
public ConstructorElementUC() { InitializeComponent(); Element = null; EnableButtons(); }
public void AssignElement(ElementC pElement) { element = pElement; }
public void SetElement(ElementC element) { Element = element; EnableButtons(); }
public void AssignElement(ElementC pElement) { element = pElement; }
public ConstructorElementUC() { InitializeComponent(); Element = null; EnableButtons(); }