public CReportItem(string aName) { _Name = aName; _Node = new TreeNode(aName); _Node.Tag = this; _Type = "item"; _Parent = null; _Killed = false; }
public CReportItem Add(CReportItem aItem) { _Expanded = true; if (_SubItems.IndexOf(aItem) < 0) { _SubItems.Add(aItem); setParentDirectly(this); } return aItem; }
public CReportItem Remove(CReportItem aItem) { int lItemId = _SubItems.IndexOf(aItem); if (lItemId > -1) { _SubItems.RemoveAt(lItemId); } aItem.Orphanize(null); return aItem; }
// public const string XMLNODE_LINK = "link"; // Later version"s will support link collections public static CReportItem CreateItemFromXMLNode(XmlNode aXmlNode) { CReportItem lResult = null; if (aXmlNode.Name == XMLNODE_FOLDER) { lResult = new CReportFolder(aXmlNode.Attributes["name"].Value); } else if (aXmlNode.Name == XMLNODE_REPORT) { lResult = new CReportFile(aXmlNode.Attributes["name"].Value, aXmlNode.Attributes["path"].Value); } else lResult = new CReportItem(aXmlNode.Attributes["name"].Value); return lResult; }
protected virtual void setParentDirectly(CReportItem aParent) { _Parent = aParent; if (aParent != null) SetCollection(aParent.Collection); else SetCollection(null); }