HyperLinkDesigner.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * Namespace: System.Web.UI.Design.WebControls
  3. * Class: HyperLinkDesigner
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer: [email protected]
  7. *
  8. * (C) Gaurav Vaish (2002)
  9. */
  10. using System;
  11. using System.Web;
  12. using System.Web.UI.WebControls;
  13. using System.Web.UI.Design;
  14. namespace System.Web.UI.Design.WebControls
  15. {
  16. public class HyperLinkDesigner : TextControlDesigner
  17. {
  18. public HyperLinkDesigner() : base()
  19. {
  20. }
  21. [MonoTODO]
  22. public override string GetDesignTimeHtml()
  23. {
  24. if(Component != null && Component is HyperLink)
  25. {
  26. HyperLink link = (HyperLink) Component;
  27. link.Text = link.Text.Trim();
  28. link.ImageUrl = link.ImageUrl.Trim();
  29. link.NavigateUrl = link.NavigateUrl.Trim();
  30. bool textOrImage = (link.Text.Length > 0 ||
  31. link.ImageUrl.Length > 0);
  32. bool nav = link.NavigateUrl.Length > 0;
  33. if(!textOrImage)
  34. {
  35. link.Text = "[" + link.ID + "]";
  36. if(!nav)
  37. {
  38. link.NavigateUrl = "url";
  39. }
  40. }
  41. // FIXME: Unable to get the essence of "Remarks"
  42. // in the MSDN documentation. Need to write a program
  43. // to test what's happening.
  44. throw new NotImplementedException();
  45. //return base.GetDesignTimeHtml();
  46. }
  47. return String.Empty;
  48. }
  49. }
  50. }