Exemplo n.º 1
0
		/// <summary>
		/// Returns an HTML table of all available icons, split into <paramref name="numColumns"/>.
		/// </summary>
		/// <param name="numColumns">Number of columns to split the table into</param>
		/// <returns>HTML table of [rendered] icons</returns>
		public static string RenderAsTable(int numColumns) {
			int currCol = 0;
			jStringBuilder sb = new jStringBuilder(true, 1);
			sb.AppendTabsLine("<table id=\"table-icons\">");
			List<string>.Enumerator e = Icons.ToList().GetEnumerator();
			while (e.MoveNext()) {
				if (currCol == 0)
					sb.Append("<tr>");

				sb.AppendTabs();
				sb.AppendFormat("<td title=\".{0}\">", e.Current);
				sb.AppendFormat(  "<span class=\"ui-icon {0}\"></span>", e.Current);
				sb.AppendFormat("</td>");

				currCol++;

				if (currCol == numColumns) {
					sb.AppendLine("</tr>");
					currCol = 0;
				}
			}			 
			sb.AppendTabsLine("</table>");
			return sb.ToString();
		}
Exemplo n.º 2
0
		/// <summary>
		/// Returns an HTML list (ul/li set) of all the available icons.
		/// </summary>
		/// <returns>HTML list (ul/li set) of all the available icons.</returns>
		public static string RenderAsList() {
			jStringBuilder sb = new jStringBuilder(true, 1);
			sb.AppendTabsLine("<ul id=\"icons\">");
			List<string>.Enumerator e = Icons.ToList().GetEnumerator();
			while (e.MoveNext()) {
				sb.AppendTabs();
				sb.AppendFormat("<li title=\".{0}\">", e.Current);
				sb.AppendFormat(  "<span class=\"ui-icon {0}\"></span>", e.Current);
				sb.AppendFormat("</li>");
				sb.AppendLine();
			}			 
			sb.AppendTabsLine("</ul>");
			return sb.ToString();
		}