/// <summary> /// Render a box /// </summary> /// <param name="box">box to render</param> public void RenderControl(UXBox box) { UXTable t = new UXTable(); UXCell c = new UXCell(); foreach (IUXObject ux in box.Children) { c.Add(ux); } Marshalling.MarshallingHash hash = Marshalling.MarshallingHash.CreateMarshalling("content", () => { return(new Dictionary <string, dynamic>() { { "ColumnCount", 1 }, { "LineCount", 1 }, { "children", ChildCollection.CreateChildCollection("row", () => { return new List <IUXObject>() { Creation.CreateRow(1, null, c) }; }) } }); }); t.Bind(hash); RenderControl(t); }
/// <summary> /// Render a single cell of a table /// </summary> /// <param name="cell">cell to render</param> public void RenderControl(UXCell cell) { VerticalZone v = new VerticalZone(); cell.Get("Width", (s, x) => { v.Width = Convert.ToUInt32(x.Value); }); cell.Get("Height", (s, x) => { v.Height = Convert.ToUInt32(x.Value); }); RenderCSSProperties(cell, v.CSS); cell.Get("Disposition", (s, x) => { v.Disposition = Enum.Parse(typeof(Disposition), x.Value); }); cell.Get("Constraint-Width", (x, y) => { EnumConstraint c; if (Enum.TryParse <EnumConstraint>(y.Value, out c)) { v.ConstraintWidth = c; } else { v.ConstraintWidth = EnumConstraint.AUTO; } }); cell.Get("Constraint-Height", (x, y) => { EnumConstraint c; if (Enum.TryParse <EnumConstraint>(y.Value, out c)) { v.ConstraintHeight = c; } else { v.ConstraintHeight = EnumConstraint.AUTO; } }); v.CountLines = 1; v.CountColumns = 1; this.currentObject.VerticalZones.Add(v); string previousContainer = this.currentContainer; dynamic previousObject = this.currentObject; this.currentContainer = v.Name; this.currentObject = this.currentMasterObject; foreach (IUXObject obj in cell.Children) { RenderControl(obj); } this.currentContainer = previousContainer; this.currentObject = previousObject; }