override public bool Parse(XmlNode node) { bool retValue = base.Parse(node); if (true == retValue) { foreach (AttributeC attrib in attributes) { if ("namespace" == attrib.Name) { NameSpace = attrib.Value; } else if ("classname" == attrib.Name) { ClassName = attrib.Value; } else if ("id" == attrib.Name) { ID = ContextC.Instance.GetClassID(); } else { MyLoggerC.Log("Unknown attribute named " + attrib.Name + " for element " + ElementName + "."); retValue = false; break; } } } return(retValue); }
override public bool Parse(XmlNode node) { bool retValue = base.Parse(node); if (true == retValue) { foreach (AttributeC attrib in attributes) { if ("name" == attrib.Name) { AttributeName = attrib.Value; } else if ("assignTo" == attrib.Name) { AssignTo = attrib.Value; } else { MyLoggerC.Log("Unknown attribute named " + attrib.Name + " for element " + ElementName + "."); retValue = false; break; } } } return(retValue); }
private void button1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); XmlClassC.Instance.FileName = openFileDialog1.FileName; ContextC.Instance.ResetClassID(); if (true != XmlClassC.Instance.Parse()) { //rtb_debug.Text = XmlClassC.Instance.DebugText(); MyLoggerC.Log("Unable to parse file " + openFileDialog1.FileName + "."); } else { MyLoggerC.Log("File \"" + openFileDialog1.FileName + "\" opened."); } tvw_treeview.Nodes.Add(XmlClassC.Instance.GetTreeNode()); }
override public bool Parse(XmlNode node) { bool retValue = base.Parse(node); if (true == retValue) { foreach (AttributeC attrib in attributes) { if ("type" == attrib.Name) { AttributeType = attrib.Value; } else if ("init" == attrib.Name) { InitType = attrib.Value; } else if ("comment" == attrib.Name) { CommentType = attrib.Value; } else if ("classkey" == attrib.Name) { ClassKeyType = attrib.Value; } else if ("id" == attrib.Name) { IdType = attrib.Value; } else if ("array" == attrib.Name) { Array = attrib.Value; } else if ("validate" == attrib.Name) { Validate = attrib.Value; } else { MyLoggerC.Log("Unknown attribute named " + attrib.Name + " for element " + ElementName + "."); retValue = false; break; } } } return(retValue); }
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; } }