コード例 #1
0
        /// <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);
                }
            }
        }
コード例 #2
0
        protected TreeNode MakeTreeNode(ChoiceRelatedClass item)
        {
            TreeNode node = new TreeNode(item.Label.Replace("_", ""));

            node.Tag             = item;
            item.ReferenceWidget = node;
            return(node);
        }
コード例 #3
0
ファイル: PaneBar.cs プロジェクト: cambell-prince/FieldWorks
        /// <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");
        }
コード例 #4
0
ファイル: SidebarAdapter.cs プロジェクト: bbriggs/FieldWorks
		/// <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;
		}
コード例 #5
0
ファイル: PaneBar.cs プロジェクト: bbriggs/FieldWorks
		/// <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";
		}