Пример #1
0
        //============================================================
        // Methods
        //============================================================

        ///
        /// <summary>
        /// Notifies server controls that use composition-based implementation to create any child controls they
        /// contain in preparation for posting back or rendering.
        /// </summary>
        /// <remarks>
        /// When you develop a composite or templated server control, you must override this method.
        /// </remarks>
        ///
        protected override void CreateChildControls()
        {
            _titleStyle = new EnhancedStyle();
            _bodyStyle  = new EnhancedStyle();

            _titleLinkButton = new LinkButton();
            _titleHyperLink  = new System.Web.UI.WebControls.HyperLink();

            // Need to explicitly set the IDs for them to be output in HTML.
            _titleLinkButton.ID = _titleLinkButton.ID;
            _titleHyperLink.ID  = _titleHyperLink.ID;

            _titleRow = new TableRow();
            Controls.Add(_titleRow);

            _titleCell = new TableCell();
            _titleRow.Controls.Add(_titleCell);

            _bodyRow = new TableRow();
            Controls.Add(_bodyRow);

            _bodyCell = new TableCell();
            _bodyRow.Controls.Add(_bodyCell);
            _bodyCell.ID = _bodyCell.ID;
            _bodyCell.Attributes.Add("id", _bodyCell.ClientID);
            _bodyCell.Width = new Unit(100, UnitType.Percentage);

            _hiddenState      = new HtmlInputHidden();
            _hiddenState.ID   = _hiddenState.ID;
            _hiddenState.Name = _hiddenState.ID;

            return;
        }
Пример #2
0
        ///
        /// <summary>
        /// Enables a server control to perform final clean up before it is released from
        /// memory.
        /// </summary>
        /// <remarks>
        /// The Dispose method leaves the Control in an unusable state. After calling this
        /// method, you must release all references to the control so the memory it was
        /// occupying can be reclaimed by garbage collection.
        /// </remarks>
        /// <param name="disposing"><b>true</b> to release both managed and unmanaged resources; <b>false</b> to release only unmanaged resources.</param>
        ///
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_license != null)
                {
                    _license.Dispose();
                    _license = null;
                }

                if (_titleRow != null)
                {
                    _titleRow.Dispose();
                    _titleRow = null;
                }

                if (_titleCell != null)
                {
                    _titleCell.Dispose();
                    _titleCell = null;
                }

                if (_bodyRow != null)
                {
                    _bodyRow.Dispose();
                    _bodyRow = null;
                }

                if (_bodyCell != null)
                {
                    _bodyCell.Dispose();
                    _bodyCell = null;
                }

                if (_titleLinkButton != null)
                {
                    _titleLinkButton.Dispose();
                    _titleLinkButton = null;
                }

                if (_titleStyle != null)
                {
                    _titleStyle.Dispose();
                    _titleStyle = null;
                }

                if (_bodyStyle != null)
                {
                    _bodyStyle.Dispose();
                    _bodyStyle = null;
                }

                if (_titleHyperLink != null)
                {
                    _titleHyperLink.Dispose();
                    _titleHyperLink = null;
                }

                if (_hiddenState != null)
                {
                    _hiddenState.Dispose();
                    _hiddenState = null;
                }
            }

            return;
        }