/// <summary> /// Retrieves the HTML to display in the designer. /// </summary> /// <returns>HTML for the designer.</returns> public override string GetDesignTimeHtml() { string html; MultiPage multiPage = (MultiPage)Component; int realIndex = 0; if (multiPage.Controls.Count == 0) { // Add a message if the MultiPage is empty return(CreatePlaceHolderDesignTimeHtml(DesignUtil.GetStringResource("MultiPageNoItems"))); } realIndex = multiPage.SelectedIndex; if (_SelectedIndex < 0) { _SelectedIndex = realIndex; } multiPage.SelectedIndex = _SelectedIndex; try { html = base.GetDesignTimeHtml(); } finally { // Restore the component multiPage.SelectedIndex = realIndex; } return(html); }
/// <summary> /// Retrieves the HTML to display in the designer. /// </summary> /// <returns>The design-time HTML.</returns> public override string GetDesignTimeHtml() { TabStrip strip = (TabStrip)Component; // If the tabstrip is empty, then add a label with instructions if (strip.Items.Count == 0) { return(CreatePlaceHolderDesignTimeHtml(DesignUtil.GetStringResource("TabStripNoItems"))); } return(base.GetDesignTimeHtml()); }
/// <summary> /// Retrieves the HTML to display in the designer. /// </summary> /// <returns>The design-time HTML.</returns> public override string GetDesignTimeHtml() { TreeView tv = (TreeView)Component; // If the TreeView is empty, then show instructions if (tv.Nodes.Count == 0) { return(CreatePlaceHolderDesignTimeHtml(DesignUtil.GetStringResource("TreePlaceHolder"))); } return(base.GetDesignTimeHtml()); }
/// <summary> /// Retrieves the HTML to display in the designer. /// </summary> /// <returns>The design-time HTML.</returns> public override string GetDesignTimeHtml() { string html; Toolbar tbar = (Toolbar)Component; // If the toolbar is empty, then add a label with instructions if (tbar.Items.Count == 0) { return(CreatePlaceHolderDesignTimeHtml(DesignUtil.GetStringResource("ToolbarNoItems"))); } bool madeBlock = false; Unit oldUnit = Unit.Empty; object obj = Behavior.GetStyleAttribute("position", false, true); bool notAbsolute = true; if ((obj != null) && (obj is string)) { notAbsolute = (String.Compare((string)obj, "absolute", true) != 0); } if ((tbar.Width == Unit.Empty) && notAbsolute) { madeBlock = true; oldUnit = tbar.Width; tbar.Width = Unit.Percentage(100.0); } try { html = base.GetDesignTimeHtml(); } finally { if (madeBlock) { tbar.Width = oldUnit; } } return(html); }