AjaxControlToolkit.HtmlEditor.Popups.BaseColorsPopup.CreateChildControls C# (CSharp) Метод

CreateChildControls() защищенный Метод

protected CreateChildControls ( ) : void
Результат void
        protected override void CreateChildControls()
        {
            var table = new Table();
            for(var i = 0; i < _colors.Length; i++) {
                var row = new TableRow();
                table.Rows.Add(row);

                for(var j = 0; j < _colors[i].Length; j++) {
                    var cell = new TableCell();
                    cell.Style[HtmlTextWriterStyle.Width] = "10px";
                    cell.Style[HtmlTextWriterStyle.Height] = "10px";
                    cell.Style[HtmlTextWriterStyle.Cursor] = "pointer";
                    cell.Style["background-color"] = "#" + _colors[i][j];
                    cell.Attributes.Add("onclick", "setColor(\"#" + _colors[i][j] + "\")");
                    row.Cells.Add(cell);

                    var innerDiv = new HtmlGenericControl("div");
                    innerDiv.Style[HtmlTextWriterStyle.Height] = "100%";
                    innerDiv.Style[HtmlTextWriterStyle.Width] = "100%";
                    innerDiv.Style["font-size"] = "1px";
                    cell.Controls.Add(innerDiv);
                }
            }

            table.Attributes.Add("border", "0");
            table.Attributes.Add("cellspacing", "1");
            table.Attributes.Add("cellpadding", "0");
            table.Style["background-color"] = "#000000";

            Content.Add(table);

            base.CreateChildControls();
        }
BaseColorsPopup