Exemple #1
0
        ///
        /// <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>
        /// If you override this method in a derived class, make sure you call this method as part of your
        /// base class's CreateChildControls.
        /// </remarks>
        ///
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            if (HttpContext.Current != null)
            {
                HttpBrowserCapabilities browserType = HttpContext.Current.Request.Browser;
                _realField = ComboBoxFieldFactory.GetField(browserType);

                _realField.SetParentComboBox(this);
            }
            else
            {
                _realField = new IE5ComboBoxField();
            }

            _realField.TextChanged += FireTextChangedEvent;

            _realField.ID = TextboxFieldId;

            Controls.Add(_realField);

            ChildControlsCreated = true;

            return;
        }
Exemple #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 (_realField != null)
                {
                    _realField.Dispose();
                    _realField = null;
                }
            }

            return;
        }
        public static DefaultComboBoxField GetField(HttpBrowserCapabilities browserCapabilities)
        {
            DefaultComboBoxField field;
            BrowserType          browserType = _parser.Parse(browserCapabilities);

            switch (browserType)
            {
            case BrowserType.IE5Up:
                field = new IE5ComboBoxField();
                break;

            case BrowserType.IE6Up:
                field = new IE6ComboBoxField();
                break;

            case BrowserType.IE7Up:
                field = new IE7ComboBoxField();
                break;

            case BrowserType.Mozilla:
                field = new MozComboBoxField();
                break;

            case BrowserType.FireFox2:
                field = new Firefox2ComboBoxField();
                break;

            case BrowserType.WebKit:
                field = new WebKitComboBoxField();
                break;

            default:
                field = new DefaultComboBoxField();
                break;
            }

            return(field);
        }