Ejemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder bulid = new StringBuilder();

            bulid.Append("ButtonWidth: " + ButtonWidth.ToString() + "\n");
            bulid.Append("ButtonHeight: " + ButtonHeight.ToString() + "\n");
            bulid.Append("ToolBarWidth: " + ToolBarWidth.ToString() + "\n");
            bulid.Append("ToolBarHeight: " + ToolBarHeight.ToString() + "\n");
            bulid.Append("SpaceWidth: " + SpaceWidth.ToString() + "\n");
            bulid.Append("SpaceHeight: " + SpaceHeight.ToString() + "\n");
            return(bulid.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Helper function to encapsulate the logic for rendering a UI button as either a text
        /// button, or as an Image.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter object associated with the
        /// current output stream.</param>
        /// <param name="controlId">The UI element Id.</param>
        /// <param name="text">The label to be displayed on the button or, in the case of an image button
        /// the associated tooltip text.</param>
        /// <param name="imgUrl">URL of an image to be displayed on the button.</param>
        /// <remarks>DrawSelectButton may be used to display either a text button, or an image button.
        /// If an image button is rendered, the text value is used as the tool tip.  If the image URL is
        /// null or the empty string, a text button will be displayed.</remarks>
        private void DrawSelectButton(HtmlTextWriter writer, string controlId, string text, string imgUrl)
        {
            if (string.IsNullOrEmpty(imgUrl))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Type, "submit");
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Type, "image");
                writer.AddAttribute(HtmlTextWriterAttribute.Src, base.ResolveClientUrl(imgUrl));
                writer.AddAttribute(HtmlTextWriterAttribute.Title, text);
                writer.AddAttribute(HtmlTextWriterAttribute.Alt, text);
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Id, controlId);
            writer.AddAttribute(HtmlTextWriterAttribute.Name, controlId);
            writer.AddAttribute(HtmlTextWriterAttribute.Value, text);
            if (ButtonWidth != Unit.Empty)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, ButtonWidth.ToString());
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Input);
            writer.RenderEndTag();
        }