ControlBuilderAttribute.cs 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // System.Web.UI.ControlBuilderAttribute.cs
  3. //
  4. // Authors:
  5. // Duncan Mak ([email protected])
  6. // Gonzalo Paniagua Javier ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc. (http://www.ximian.com)
  9. using System;
  10. namespace System.Web.UI {
  11. [AttributeUsage (AttributeTargets.Class)]
  12. public sealed class ControlBuilderAttribute : Attribute
  13. {
  14. Type builderType;
  15. public static readonly ControlBuilderAttribute Default = new ControlBuilderAttribute (null);
  16. public ControlBuilderAttribute (Type builderType)
  17. {
  18. this.builderType = builderType;
  19. }
  20. public Type BuilderType {
  21. get { return builderType; }
  22. }
  23. public override bool Equals (object obj)
  24. {
  25. if (!(obj is ControlBuilderAttribute))
  26. return false;
  27. return ((ControlBuilderAttribute) obj).builderType == builderType;
  28. }
  29. public override int GetHashCode ()
  30. {
  31. return base.GetHashCode ();
  32. }
  33. public override bool IsDefaultAttribute ()
  34. {
  35. return Equals (Default);
  36. }
  37. }
  38. }