示例#1
0
        /// <summary>
        /// 添加选项(lamda表达式)
        /// </summary>
        /// <param name="tabAction"></param>
        /// <returns></returns>
        public TabBuilder AddTab(Action <TabMenuOption> tabAction)
        {
            var tabMenuOption = new TabMenuOption();

            if (tabAction != null)
            {
                tabAction(tabMenuOption);
            }
            _options.Add(tabMenuOption);
            return(this);
        }
        /// <summary>
        /// 添加选项
        /// </summary>
        /// <param name="targetSelecter">选项卡目标选择器 jQuery 选择器</param>
        /// <param name="value">选项卡选项值</param>
        /// <param name="htmlAttributes">选项卡选项属性</param>
        /// <returns></returns>
        public Global_TabMenu AddOption(string targetSelecter, string value, object htmlAttributes = null)
        {
            var option = new TabMenuOption()
            {
                TargetSelecter = targetSelecter,
                Value          = value,
                HtmlAttributes = HtmlExtensionsTools.ObjectToHtmlAttributes(htmlAttributes)
            };

            if (this.Options == null)
            {
                this.Options = new List <TabMenuOption>();
            }
            this.Options.Add(option);
            return(this);
        }