System.Web.UI.WebControls.MenuListRenderer.RenderLevelStyles C# (CSharp) Method

RenderLevelStyles() private method

private RenderLevelStyles ( System.Web.UI.WebControls.StyleBlock block, int num, IList levelStyles, string name, string unitName = null, double indent ) : void
block System.Web.UI.WebControls.StyleBlock
num int
levelStyles IList
name string
unitName string
indent double
return void
		void RenderLevelStyles (StyleBlock block, int num, IList levelStyles, string name, string unitName = null, double indent = 0)
		{
			int stylesCount = levelStyles != null ? levelStyles.Count : 0;
			bool haveStyles = stylesCount > 0;
			if (!haveStyles || block == null)
				return;

			NamedCssStyleCollection css;
			Style style;
			bool haveIndent = !String.IsNullOrEmpty (unitName) && indent != 0;
			for (int i = 0; i < stylesCount; i++) {
				if ((i == 0 && !haveStyles))
					continue;
				
				css = block.RegisterStyle (name + (i + 1));
				if (haveStyles && stylesCount > i) {
					style = levelStyles [i] as Style;
					if (style != null) {
						style.AlwaysRenderTextDecoration = true;
						css.CopyFrom (style.GetStyleAttributes (null));
					}
				}
				
				if (haveIndent && i > 0 && i < num) {
					css.Add (HtmlTextWriterStyle.PaddingLeft, indent.ToString (CultureInfo.InvariantCulture) + unitName);
					indent += indent;
				}
			}
		}
	}