/// <summary> /// Converts from a property bag to a live wrapper. If the current /// wrapper is not a bag, then it creates a new wrapper around the live /// HtmlElement. /// </summary> private void ConvertBagWrapper() { HtmlElementWrapperBag bag = _wrapper as HtmlElementWrapperBag; if (bag == null) { _wrapper = new HtmlElementWrapper(_htmlElement); } else { // Create the live, direct-wired wrapper to the element _wrapper = new HtmlElementWrapper(_htmlElement, bag); } }
/// <summary> /// Initialize the HtmlControlBase and its fields. /// </summary> private HtmlControlBase() { _wrapper = new HtmlElementWrapperBag(); _controls = new HtmlControlCollection(this); }