Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.5 KiB

  1. using System;
  2. using System.Web;
  3. using System.Web.UI;
  4. namespace UDDI.Web
  5. {
  6. public class Box : Control, INamingContainer
  7. {
  8. protected bool downlevel = false;
  9. public bool Downlevel
  10. {
  11. get { return downlevel; }
  12. set { downlevel = value; }
  13. }
  14. public Box()
  15. {
  16. }
  17. protected override void OnInit( EventArgs e )
  18. {
  19. Downlevel =
  20. 0 != Page.Request.Browser.Type.IndexOf( "IE" ) ||
  21. Page.Request.Browser.MajorVersion < 5;
  22. }
  23. protected override void Render( HtmlTextWriter output )
  24. {
  25. if( !Downlevel )
  26. {
  27. output.AddAttribute( HtmlTextWriterAttribute.Class, "boxed" );
  28. output.RenderBeginTag( HtmlTextWriterTag.Div );
  29. this.RenderChildren( output );
  30. output.RenderEndTag();
  31. }
  32. else
  33. {
  34. output.AddAttribute( HtmlTextWriterAttribute.Cellpadding, "10" );
  35. output.AddAttribute( HtmlTextWriterAttribute.Cellspacing, "0" );
  36. output.AddAttribute( HtmlTextWriterAttribute.Border, "1" );
  37. output.AddAttribute( HtmlTextWriterAttribute.Bgcolor, "#f0f8ff" );
  38. output.AddAttribute( HtmlTextWriterAttribute.Bordercolor, "#639ace" );
  39. output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" );
  40. output.RenderBeginTag( HtmlTextWriterTag.Table );
  41. output.RenderBeginTag( HtmlTextWriterTag.Tr );
  42. output.AddAttribute( HtmlTextWriterAttribute.Width, "100%" );
  43. output.RenderBeginTag( HtmlTextWriterTag.Td );
  44. this.RenderChildren( output );
  45. output.RenderEndTag();
  46. output.RenderEndTag();
  47. output.RenderEndTag();
  48. }
  49. }
  50. }
  51. }