Exemplo n.º 1
0
        /// <summary>
        /// 处理前操作
        /// </summary>
        /// <param name="context">TagHelper上下文</param>
        /// <param name="output">TagHelper输出</param>
        protected override void ProcessBefore(TagHelperContext context, TagHelperOutput output)
        {
            var shareConfig = context.GetValueFromItems <ColumnShareConfig>(ColumnConfig.ColumnShareKey);

            if (shareConfig != null)
            {
                shareConfig.AutoCreateHeaderCell = false;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 处理前操作
        /// </summary>
        /// <param name="context">TagHelper上下文</param>
        /// <param name="output">TagHelper输出</param>
        protected override void ProcessBefore(TagHelperContext context, TagHelperOutput output)
        {
            var shareConfig = context.GetValueFromItems <TableShareConfig>(TableConfig.TableShareKey);

            if (shareConfig != null)
            {
                shareConfig.AutoCreateRow = false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初始化共享实例
        /// </summary>
        public void InitShare(TagHelperContext context)
        {
            var shareConfig = context.GetValueFromItems <TableShareConfig>();

            if (shareConfig == null)
            {
                shareConfig = new TableShareConfig(GetId(context));
                context.SetValueToItems(shareConfig);
            }
            InitShareConfig(context, shareConfig);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 从TagHelperContext Items里获取值
 /// </summary>
 /// <typeparam name="T">返回类型</typeparam>
 /// <param name="key">键</param>
 public T GetValueFromItems <T>(object key)
 {
     return(TagHelperContext.GetValueFromItems <T>(key));
 }