/// <summary> /// Create a node from a prerequisite certificate. /// </summary> /// <param name="certLevel">The cert level.</param> /// <returns></returns> private static TreeNode CreateNode(CertificateLevel certLevel) { TreeNode node = new TreeNode { Text = certLevel.ToString(), Tag = certLevel }; foreach (SkillLevel prereqSkill in certLevel.PrerequisiteSkills) { node.Nodes.Add(CreateNode(prereqSkill)); } return node; }
/// <summary> /// Updates a "plan to" menu. /// </summary> /// <param name="menu">The menu to update</param> /// <param name="certLevel">The level represent by this menu</param> /// <param name="lastEligibleCertLevel">The highest eligible certificate after this plan</param> private bool UpdatePlanningMenuStatus(ToolStripItem menu, CertificateLevel certLevel, CertificateLevel lastEligibleCertLevel) { menu.Enabled = certLevel != null && (lastEligibleCertLevel == null || certLevel.Level > lastEligibleCertLevel.Level); if (menu.Enabled) menu.Tag = m_plan.TryPlanTo(certLevel); return menu.Enabled; }