/// <summary> /// /// </summary> /// <param name="group"></param> public void AddGroup(ChoiceGroup group) { ClearMainPanelControls(); ArrayList l = new ArrayList(group.Count); foreach (ChoiceRelatedClass item in group) { l.Add(item); } l.Reverse(); foreach (ChoiceRelatedClass item in l) { ChoiceRelatedClass choice = (ChoiceRelatedClass)Tag; UIItemDisplayProperties display = item.GetDisplayProperties(); if (!display.Visible) { continue; } if (item is ChoiceBase) { AddHotlink((ChoiceBase)item); } else if (item is ChoiceGroup) { AddMenu((ChoiceGroup)item); } } }
protected TreeNode MakeTreeNode(ChoiceRelatedClass item) { TreeNode node = new TreeNode(item.Label.Replace("_", "")); node.Tag = item; item.ReferenceWidget = node; return(node); }
/// <summary> /// Get the optional 'alignment' attribute from config XML. /// Returns true if we want 'normal' left justification. /// Returns false if we want right-ish justification. /// </summary> /// <param name="choice"></param> /// <returns></returns> private static bool GetOptionalMenuAlignment(ChoiceRelatedClass choice) { if (choice == null || choice.ConfigurationNode == null) { return(true); } var alignmentAttr = XmlUtils.GetOptionalAttributeValue(choice.ConfigurationNode, "alignment", "left"); return(alignmentAttr == "left"); }
/// <summary> /// Make an individual tree node. /// </summary> /// <param name="item">Definition of the node being created.</param> /// <returns>The newly created node.</returns> protected TreeNode MakeTreeNode(ChoiceRelatedClass item) { TreeNode node = new TreeNode(item.Label.Replace("_","")); node.Tag = item; item.ReferenceWidget = node; return node; }
/// <summary> /// Get the optional 'alignment' attribute from config XML. /// Returns true if we want 'normal' left justification. /// Returns false if we want right-ish justification. /// </summary> /// <param name="choice"></param> /// <returns></returns> private static bool GetOptionalMenuAlignment(ChoiceRelatedClass choice) { if (choice == null || choice.ConfigurationNode == null) return true; var alignmentAttr = XmlUtils.GetOptionalAttributeValue(choice.ConfigurationNode, "alignment", "left"); return alignmentAttr == "left"; }