SetContent() public method

public SetContent ( int r, int c, RenderElement re ) : void
r int
c int
re RenderElement
return void
コード例 #1
0
        public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
        {
            if (gridBoxRenderE == null)
            {
                var myGridBox = new GridBoxRenderElement(rootgfx, this.Width, this.Height);
                myGridBox.SetLocation(this.Left, this.Top);
                this.SetPrimaryRenderElement(myGridBox);
                this.gridBoxRenderE = myGridBox;
                //create layers
                int nrows = this.gridTable.RowCount;
                int ncols = this.gridTable.ColumnCount;
                //----------------------------------------

                myGridBox.BuildGrid(ncols, nrows, this.CellSizeStyle);
                //add grid content
                for (int c = 0; c < ncols; ++c)
                {
                    for (int r = 0; r < nrows; ++r)
                    {
                        var gridCell = gridTable.GetCell(r, c);
                        var content  = gridCell.ContentElement as UIElement;
                        if (content != null)
                        {
                            myGridBox.SetContent(r, c, content);
                        }
                    }
                }
            }
            return(gridBoxRenderE);
        }
コード例 #2
0
 public void AddUI(UIElement ui, int rowIndex, int colIndex)
 {
     if (rowIndex < gridTable.RowCount && colIndex < gridTable.ColumnCount)
     {
         gridTable.GetCell(rowIndex, colIndex).ContentElement = ui;
         if (this.gridBoxRenderE != null)
         {
             gridBoxRenderE.SetContent(rowIndex, colIndex, ui.GetPrimaryRenderElement(gridBoxRenderE.Root));
         }
     }
 }
コード例 #3
0
ファイル: 5_GridBox.cs プロジェクト: prepare/HTML-Renderer
        public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
        {
            if (gridBoxRenderE == null)
            {
                var myGridBox = new GridBoxRenderElement(rootgfx, this.Width, this.Height);
                myGridBox.SetLocation(this.Left, this.Top);
                this.SetPrimaryRenderElement(myGridBox);
                this.gridBoxRenderE = myGridBox;
                //create layers
                int nrows = this.gridTable.RowCount;
                int ncols = this.gridTable.ColumnCount;
                //----------------------------------------        

                myGridBox.BuildGrid(ncols, nrows, this.CellSizeStyle);
                //add grid content
                for (int c = 0; c < ncols; ++c)
                {
                    for (int r = 0; r < nrows; ++r)
                    {
                        var gridCell = gridTable.GetCell(r, c);
                        var content = gridCell.ContentElement as UIElement;
                        if (content != null)
                        {
                            myGridBox.SetContent(r, c, content);
                        }
                    }
                }
            }
            return gridBoxRenderE;
        }