Esempio n. 1
0
        private void RenderItem(HtmlTextWriter writer, ToolBarItem item)
        {
            if (item.Content != null)
            {
                item.Content.InstantiateIn(this);
                this.RenderChildren(writer);
                this.Controls.Clear();
                return;
            }

            if (!string.IsNullOrWhiteSpace(item.Icon))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "icon icon-" + item.Icon.Trim());
                writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
            }

            if (!string.IsNullOrWhiteSpace(item.Name))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Name, item.Name);
            }

            if (!string.IsNullOrWhiteSpace(item.ToolTip))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Title, BindingUtility.FormatBindingValue(item.ToolTip, this.GetBindingSource()));
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "toolbar-button");
            writer.AddAttribute(HtmlTextWriterAttribute.Href, string.IsNullOrWhiteSpace(item.Url) ? Utility.EmptyLink : BindingUtility.FormatBindingValue(item.Url, this.GetBindingSource()));
            writer.RenderBeginTag(HtmlTextWriterTag.A);

            if (!string.IsNullOrEmpty(item.Text))
            {
                writer.WriteEncodedText(item.Text);
            }

            writer.RenderEndTag();
        }
Esempio n. 2
0
		private void RenderItem(HtmlTextWriter writer, ToolBarItem item)
		{
			if(item.Content != null)
			{
				item.Content.InstantiateIn(this);
				this.RenderChildren(writer);
				this.Controls.Clear();
				return;
			}

			if(!string.IsNullOrWhiteSpace(item.Icon))
			{
				writer.AddAttribute(HtmlTextWriterAttribute.Class, "icon icon-" + item.Icon.Trim());
				writer.RenderBeginTag(HtmlTextWriterTag.I);
				writer.RenderEndTag();
			}

			if(!string.IsNullOrWhiteSpace(item.Name))
				writer.AddAttribute(HtmlTextWriterAttribute.Name, item.Name);

			if(!string.IsNullOrWhiteSpace(item.ToolTip))
				writer.AddAttribute(HtmlTextWriterAttribute.Title, BindingUtility.FormatBindingValue(item.ToolTip, this.GetBindingSource()));

			writer.AddAttribute(HtmlTextWriterAttribute.Class, "toolbar-button");
			writer.AddAttribute(HtmlTextWriterAttribute.Href, string.IsNullOrWhiteSpace(item.Url) ? Utility.EmptyLink : BindingUtility.FormatBindingValue(item.Url, this.GetBindingSource()));
			writer.RenderBeginTag(HtmlTextWriterTag.A);

			if(!string.IsNullOrEmpty(item.Text))
				writer.WriteEncodedText(item.Text);

			writer.RenderEndTag();
		}