Exemplo n.º 1
0
        /// <summary>
        /// Create tree
        /// </summary>
        /// <param name="properties">props</param>
        /// <param name="id">id</param>
        /// <param name="first">first row</param>
        /// <param name="nexts">next rows</param>
        /// <returns>ux tree</returns>
        public static UXTree CreateTree(Marshalling.MarshallingHash properties, string id, UXRow first, params UXRow[] nexts)
        {
            UXTree t = UXTree.CreateUXTree("tree", () =>
            {
                List <UXRow> rows = new List <UXRow>();
                rows.Add(first);
                rows = rows.Concat(nexts).ToList();
                return(new Dictionary <string, dynamic>()
                {
                    { "Id", id },
                    { "children", rows }
                });
            });

            if (properties != null)
            {
                t.Bind(properties);
            }
            return(t);
        }