TargetConverter.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * Namespace: System.Web.UI.WebControls
  3. * Class: TargetConverter
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer: [email protected]
  7. * Contact: <[email protected]>, <[email protected]>
  8. * Implementation: yes
  9. * Status: 100%
  10. *
  11. * (C) Gaurav Vaish (2002)
  12. */
  13. using System;
  14. using System.ComponentModel;
  15. using System.Web;
  16. using System.Web.UI;
  17. namespace System.Web.UI.WebControls
  18. {
  19. public class TargetConverter : StringConverter
  20. {
  21. private StandardValuesCollection standardValues;
  22. private string[] values = {
  23. "_parent",
  24. "_self",
  25. "_blank",
  26. "_search",
  27. "_top"
  28. };
  29. public TargetConverter(): base()
  30. {
  31. }
  32. public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
  33. {
  34. if(standardValues == null)
  35. {
  36. standardValues = new StandardValuesCollection(values);
  37. }
  38. return standardValues;
  39. }
  40. public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
  41. {
  42. return false;
  43. }
  44. public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
  45. {
  46. return true;
  47. }
  48. }
  49. }