protected internal override void OnInit (EventArgs e)
{
base.OnInit (e);
List <string> themes = null;
AddStyleSheets (StyleSheetPageTheme, ref themes);
AddStyleSheets (PageTheme, ref themes);
if (themes == null)
return;
HtmlHead header = Header;
if (themes != null && header == null)
throw new InvalidOperationException ("Using themed css files requires a header control on the page.");
ControlCollection headerControls = header.Controls;
string lss;
for (int i = themes.Count - 1; i >= 0; i--) {
lss = themes [i];
HtmlLink hl = new HtmlLink ();
hl.Href = lss;
hl.Attributes["type"] = "text/css";
hl.Attributes["rel"] = "stylesheet";
headerControls.AddAt (0, hl);
}
}