public static TagControl GetControlInstance(Panel panel, Tag tag, UserControlBase upControl, UserControlBase downControl) { //UserControlBase control; TagControl control; control = new TagControl(tag); control.Location = new System.Drawing.Point(10, 20); //rowCollection.Name = "Data" + columnCount; control.Size = new System.Drawing.Size(800, 30); control.TabIndex = 0; control.UpControl = upControl; control.DownControl = downControl; panel.Controls.Add(control); return control; }
public static TagControl GetControlInstance(Panel panel, Tag tag, UserControlBase upControl, UserControlBase downControl) { //UserControlBase control; TagControl control; control = new TagControl(tag); control.Location = new System.Drawing.Point(10, 20); //rowCollection.Name = "Data" + columnCount; control.Size = new System.Drawing.Size(800, 30); control.TabIndex = 0; control.UpControl = upControl; control.DownControl = downControl; panel.Controls.Add(control); return(control); }
private void LoadXMLChild(TreeNode treeNode, XmlNode xmlNode) { TreeNode newTreeNode; foreach (XmlNode node in xmlNode.ChildNodes) { if (node.NodeType == XmlNodeType.Element) { if (node.Name == "tag") { if (node.Attributes["type"] != null) { // check if node is type of object if (node.Attributes["type"].Value == "object") { if (treeNode != null) { // if treeNode not null then build contorl nodes newTreeNode = new TreeNode(node.Attributes["name"].Value); newTreeNode.Name = node.Attributes["name"].Value; treeNode.Nodes.Add(newTreeNode); if (node.HasChildNodes) { LoadXMLChild(newTreeNode, node); } } } else { Tag tag = new Tag(node.Attributes["name"].Value, ""); TagControl tagControl = TagControl.GetControlInstance(pParametars, tag, tagControlLastTmp, null); tagControlLastTmp = tagControl; if (node.HasChildNodes) { LoadXMLChild(treeNode, node); } } } else { ModuleLog.Write("Bad xml format \r\n" + node.InnerXml, this, "LoadXMLChild", ModuleLog.LogType.WARNING); } } else if (node.Name == "syntax") { tbSyntax.Text = node.InnerText; } else if (node.Name == "result") { lblResult.Text = "Result: " + node.InnerText; } else if (node.Name == "example") { lblExample.Text = "Example: " + node.InnerText; } else { if (node.HasChildNodes) { LoadXMLChild(treeNode, node); } } } } }