Ejemplo n.º 1
0
        /// <summary>
        /// 添加操作表格
        /// 被选择的数据项的主键将用脚本参数 (默认 selectedId) 传递
        /// </summary>
        /// <param name="display"></param>
        /// <param name="script">脚本参数 (默认 selectedId)</param>
        /// <returns></returns>
        public ITableAction AddActionTable(string display, string script)
        {
            if (string.IsNullOrWhiteSpace(display))
            {
                throw new ArgumentNullException("display");
            }
            if (string.IsNullOrWhiteSpace(script))
            {
                throw new ArgumentNullException("script");
            }

            var action = new DynamicTableAction(display, script, LinkBehave.Script);

            TableActions.Add(action);
            return(action);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加操作表格
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public ITableAction AddActionTable(ILocation location)
        {
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }
            if (location.Behave == LinkBehave.Script)
            {
                throw new ArgumentException("路径不能设置 LinkBehave.Script", "location.Behave");
            }

            var action = new DynamicTableAction(location.Display, location.Path, location.Behave);

            TableActions.Add(action);
            return(action);
        }