private void ParseRequirements(ReqPro40.Package___v1 rpxPkg, ReqTreeNode tn) { ReqPro40.Requirement___v6 rpxReq; ReqPro40.Package___v1 rpxPkgChild; ReqTreeNode tnPkgChild; ReqTreeNode tnReqNew; int nKey; int i; object[,] o = (object[, ])rpxPkg.KeyList(ReqPro40.enumElementTypes.eElemType_Requirement); for (i = 0; i < o.GetLength(1); i++) { if (o[0, i] != null) { nKey = (int)o[0, i]; rpxReq = GetRequirement(nKey); tnReqNew = new ReqTreeNode (rpxReq.get_Tag(ReqPro40.enumTagFormat.eTagFormat_Tag) + ": " + rpxReq.Name, rpxReq.key, ReqTreeNode.eReqTreeNodeType.eTreeNodeReq); tn.Add(ref tnReqNew); ParseReqChildren(rpxReq, tnReqNew); } } for (i = 0; i < tn.Count; i++) { tnPkgChild = tn[i]; if (tnPkgChild.IsPackage()) { rpxPkgChild = (ReqPro40.Package___v1)rpxProject.GetPackage(tnPkgChild.Key, ReqPro40.enumPackageWeights.ePackageWeight_Empty); //tnPkgChild = (ReqTreeNode)dictPackage[rpxPkgChild.PackageKey]; ParseRequirements(rpxPkgChild, tnPkgChild); } } }
private void ReadReqTreeNode(ReqPro40.Package___v1 rpxPackage, ref ReqTreeNode reqParentTreeNode, ref int nPackageRead) { ReqPro40.Package___v1 rpxChildPackage; ReqTreeNode reqMyTreeNode; reqMyTreeNode = new ReqTreeNode(rpxPackage.Name, rpxPackage.key, ReqTreeNode.eReqTreeNodeType.eTreeNodePkg); reqParentTreeNode.Add(ref reqMyTreeNode); dictPackage.Add(rpxPackage.key, reqMyTreeNode); cb.ShowProgressReqPkgTree(0, ++nPackageRead, 0, 0, null); rpxPackage.MoveFirst(); while (!rpxPackage.IsEOF) { rpxChildPackage = (ReqPro40.Package___v1)rpxPackage.GetCurrentElement(); ReadReqTreeNode(rpxChildPackage, ref reqMyTreeNode, ref nPackageRead); rpxPackage.MoveNext(); } }