Example #1
0
        /// <summary>
        /// Create table
        /// </summary>
        /// <param name="parent">parent ui</param>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXTable CreateUXTable(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXTable table = new UXTable();

            table.Bind(data);
            table.Bind(ui);
            foreach (Marshalling.IMarshalling m in table.GetProperty("childs").Values)
            {
                table.Add(m.Value);
            }
            return(table);
        }
Example #2
0
        /// <summary>
        /// Create a table
        /// </summary>
        /// <param name="name">name of table</param>
        /// <param name="ColumnCount">column count</param>
        /// <param name="LineCount">line count</param>
        /// <param name="properties">props</param>
        /// <param name="rows">lines</param>
        /// <returns>ux table</returns>
        public static UXTable CreateTable(string name, uint ColumnCount, uint LineCount, Marshalling.MarshallingHash properties, params UXRow[] rows)
        {
            UXTable t = UXTable.CreateUXTable(name, () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "ColumnCount", ColumnCount },
                    { "LineCount", LineCount },
                    { "children", UXFramework.Creation.CreateChildren(rows) }
                });
            });

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