/// <summary>
        /// Attempts to parse the specified <see cref="ReportNodeType"/> and add to the collection if successfully parsed.
        /// </summary>
        /// <param name="node">The <see cref="ReportNodeType"/> instance contains the report node data read from the XML report.</param>
        /// <param name="parentNode">The parent <see cref="ReportNodeType"/> instance contains the report node data read from the XML report.</param>
        /// <returns>The newly created report node instance from the <see cref="ReportNodeType"/> instance.</returns>
        public T TryParseAndAdd(ReportNodeType node, ReportNodeType parentNode)
        {
            if (node == null || Factory == null)
            {
                return(null);
            }

            // create report node instance via factory
            T reportNode = Factory.Create <T>(node, parentNode, Owner);

            if (reportNode == null)
            {
                return(null);
            }

            // try to parse the report node data
            if (!reportNode.TryParse())
            {
                return(null);
            }

            _list.Add(reportNode);
            return(reportNode);
        }
Example #2
0
 public GeneralReportNode(ReportNodeType node, IReportNodeOwner owner)
 {
     Node      = node;
     Owner     = owner;
     OwnerTest = Owner != null ? Owner.OwnerTest : null;
 }