예제 #1
0
        //public void unselect()
        //{
        //    this._panelAreaButton.Style.Add("background", "transparent");
        //    this._src.Selected = false;
        //}

        //public void select()
        //{
        //    this._panelAreaButton.Style.Add("background", "red");
        //}

        protected override void OnInit(EventArgs e)
        {
            //PostBackOptions p = new PostBackOptions(this);

            this._panelAreaButton          = new Panel();
            this._panelAreaButton.ID       = _src.ID;
            this._panelAreaButton.CssClass = "OfficeWebUI_WorkspaceAreaButton";
            this._panelAreaButton.Attributes.Add("AssociatedArea", _src.ID);
            this._panelAreaButton.Attributes.Add("AreaId", _src.ID);
            //this._panel.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(p));
            this.Controls.Add(_panelAreaButton);

            //_panelAreaButton.Controls.Add(new Literal { Text = _src.Text });


            Table lTable = new Table();

            lTable.CellPadding = 2;
            lTable.CellSpacing = 0;
            this._panelAreaButton.Controls.Add(lTable);

            TableRow lTableRow = new TableRow();

            lTable.Controls.Add(lTableRow);

            TableCell lTableCellImage = new TableCell();

            lTableRow.Controls.Add(lTableCellImage);

            Image lImage = new Image();

            lImage.ImageUrl = (!String.IsNullOrEmpty(_src.ImageUrl)) ? _src.ImageUrl : Page.ClientScript.GetWebResourceUrl(this.GetType(), "OfficeWebUI.Resources.Common.Image.blank.gif");
            lImage.Width    = 16;
            lImage.Height   = 16;
            lTableCellImage.Controls.Add(lImage);

            TableCell lTableCellText = new TableCell();

            lTableRow.Controls.Add(lTableCellText);

            Literal lText = new Literal();

            lText.Text = _src.Text;
            lTableCellText.Controls.Add(lText);



            this._panelAreaContainer          = new Panel();
            this._panelAreaContainer.CssClass = "OfficeWebUI_WorkspaceAreaZone";
            this._panelAreaContainer.Attributes.Add("AssociatedArea", _src.ID);
            _sectionsContainer.Controls.Add(_panelAreaContainer);


            foreach (Section lSectionSrc in _src.Sections)
            {
                SectionRenderer lSection = new SectionRenderer(lSectionSrc);
                _panelAreaContainer.Controls.Add(lSection);
            }

            base.OnInit(e);
        }
예제 #2
0
        //public void unselect()
        //{
        //    this._panelAreaButton.Style.Add("background", "transparent");
        //    this._src.Selected = false;
        //}
        //public void select()
        //{
        //    this._panelAreaButton.Style.Add("background", "red");
        //}
        protected override void OnInit(EventArgs e)
        {
            //PostBackOptions p = new PostBackOptions(this);

            this._panelAreaButton = new Panel();
            this._panelAreaButton.ID = _src.ID;
            this._panelAreaButton.CssClass = "OfficeWebUI_WorkspaceAreaButton";
            this._panelAreaButton.Attributes.Add("AssociatedArea", _src.ID);
            this._panelAreaButton.Attributes.Add("AreaId", _src.ID);
            //this._panel.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(p));
            this.Controls.Add(_panelAreaButton);

            //_panelAreaButton.Controls.Add(new Literal { Text = _src.Text });

            Table lTable = new Table();
            lTable.CellPadding = 2;
            lTable.CellSpacing = 0;
            this._panelAreaButton.Controls.Add(lTable);

            TableRow lTableRow = new TableRow();
            lTable.Controls.Add(lTableRow);

            TableCell lTableCellImage = new TableCell();
            lTableRow.Controls.Add(lTableCellImage);

            Image lImage = new Image();
            lImage.ImageUrl = (!String.IsNullOrEmpty(_src.ImageUrl)) ? _src.ImageUrl : Page.ClientScript.GetWebResourceUrl(this.GetType(), "OfficeWebUI.Resources.Common.Image.blank.gif");
            lImage.Width = 16;
            lImage.Height = 16;
            lTableCellImage.Controls.Add(lImage);

            TableCell lTableCellText = new TableCell();
            lTableRow.Controls.Add(lTableCellText);

            Literal lText = new Literal();
            lText.Text = _src.Text;
            lTableCellText.Controls.Add(lText);

            this._panelAreaContainer = new Panel();
            this._panelAreaContainer.CssClass = "OfficeWebUI_WorkspaceAreaZone";
            this._panelAreaContainer.Attributes.Add("AssociatedArea", _src.ID);
            _sectionsContainer.Controls.Add(_panelAreaContainer);

            foreach (Section lSectionSrc in _src.Sections)
            {
                SectionRenderer lSection = new SectionRenderer(lSectionSrc);
                _panelAreaContainer.Controls.Add(lSection);
            }

            base.OnInit(e);
        }