RunInstallerAttribute.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // System.ComponentModel.RunInstallerAttribute.cs
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. // Andreas Nahr ([email protected])
  7. //
  8. // (C) 2003 Ximian, Inc (http://www.ximian.com)
  9. // (C) 2003 Andreas Nahr
  10. //
  11. using System;
  12. namespace System.ComponentModel
  13. {
  14. [AttributeUsageAttribute(AttributeTargets.Class)]
  15. public class RunInstallerAttribute : Attribute
  16. {
  17. public static readonly RunInstallerAttribute Yes = new RunInstallerAttribute (true);
  18. public static readonly RunInstallerAttribute No = new RunInstallerAttribute (false);
  19. public static readonly RunInstallerAttribute Default = new RunInstallerAttribute (false);
  20. private bool runInstaller;
  21. public RunInstallerAttribute (bool runInstaller)
  22. {
  23. this.runInstaller = runInstaller;
  24. }
  25. public override bool Equals (object obj)
  26. {
  27. if (!(obj is RunInstallerAttribute))
  28. return false;
  29. return ((RunInstallerAttribute) obj).RunInstaller.Equals (runInstaller);
  30. }
  31. public override int GetHashCode ()
  32. {
  33. return runInstaller.GetHashCode ();
  34. }
  35. public override bool IsDefaultAttribute ()
  36. {
  37. return Equals (Default);
  38. }
  39. public bool RunInstaller
  40. {
  41. get { return runInstaller; }
  42. }
  43. }
  44. }