Example #1
0
        protected override HtmlElement CreateDOMElementForDisplayMode(string displayMode)
        {
            switch (displayMode)
            {
                case "Menu":
                    _elmDefault = new Table();
                    _elmDefault.SetAttribute("mscui:controltype", ControlType);

                    _elmDefaultTbody = new TableBody();
                    _elmDefaultTbody.ClassName = "ms-cui-it";
                    _elmDefault.SetAttribute("cellspacing", "0");
                    _elmDefault.SetAttribute("cellpadding", "0");
                    _elmDefaultTbody.SetAttribute("cellspacing", "0");
                    _elmDefaultTbody.SetAttribute("cellpadding", "0");

                    _elmDefault.MouseOut += OnControlMouseOut;

                    EnsureDivArrays();

                    TableRow elmRow;
                    TableCell elmCell;
                    Anchor elmCellA;
                    Div elmDiv;
                    Div elmDivOuter;
                    int idx = 0;
                    for (int i = 0; i < 10; i++)
                    {
                        elmRow = new TableRow();
                        _elmDefaultTbody.AppendChild(elmRow);
                        for (int j = 0; j < 10; j++)
                        {
                            elmCell = new TableCell();
                            elmCell.Style.Padding = "0px";
                            elmRow.AppendChild(elmCell);

                            elmCellA = new Anchor();

                            Utility.NoOpLink(elmCellA);
                            Utility.SetAriaTooltipProperties(Properties, elmCellA);

                            elmCellA.Focus += OnCellFocus;
                            elmDiv = new Div();
                            elmDiv.ClassName = "ms-cui-it-inactiveCell";

                            elmDivOuter = new Div();
                            elmDivOuter.Id = this.Id + "-" + idx;
                            elmDivOuter.ClassName = "ms-cui-it-inactiveCellOuter";

                            elmCell.MouseOver += OnCellHover;
                            elmCell.Click += OnCellClick;
                            elmCell.AppendChild(elmDivOuter);
                            elmDivOuter.AppendChild(elmDiv);
                            elmDiv.AppendChild(elmCellA);

                            _innerDivs[idx] = elmDiv;
                            _outerDivs[idx] = elmDivOuter;
                            idx++;
                        }
                    }

                    _elmDefault.AppendChild(_elmDefaultTbody);
                    return _elmDefault;
                default:
                    EnsureValidDisplayMode(displayMode);
                    break;
            }
            return null;
        }
Example #2
0
        protected override HtmlElement CreateDOMElementForDisplayMode(string displayMode)
        {
            switch (displayMode)
            {
                case "Menu":
                    if (Root.TextDirection == Direction.RTL)
                    {
                        _colorTable.Dir = "rtl";
                    }
                    else
                    {
                        _colorTable.Dir = "ltr";
                    }

                    _colorTable.ClassName = "ms-cui-smenu-inner";
                    _colorTable.SetAttribute("cellSpacing", "0");
                    _colorTable.SetAttribute("cellPadding", "0");
                    _colorTable.SetAttribute("mscui:controltype", ControlType);

                    TableBody colorTableBody = new TableBody();
                    AddColorCells(colorTableBody, _colors);
                    _colorTable.AppendChild(colorTableBody);

                    return _colorTable;
                default:
                    EnsureValidDisplayMode(displayMode);
                    break;
            }
            return null;
        }
Example #3
0
 public override void Dispose()
 {
     base.Dispose();
     _elmDefault = null;
     _elmDefaultTbody = null;
 }
Example #4
0
 internal override void RefreshInternal()
 {
     EnsureDOMElementAndEmpty();
     TableBody tbody = new TableBody();
     ElementInternal.AppendChild(tbody);
     AppendChildrenToElement(tbody);
 }