ToolInfo.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using System;
  2. namespace PaintDotNet.Measurement
  3. {
  4. public class ToolInfo
  5. {
  6. private string name;
  7. private string helpText;
  8. private ImageResource image;
  9. private bool skipIfActiveOnHotKey;
  10. private char hotKey;
  11. private Type toolType;
  12. private ToolBarConfigItems toolBarConfigItems;
  13. public string Name
  14. {
  15. get
  16. {
  17. return this.name;
  18. }
  19. }
  20. public string HelpText
  21. {
  22. get
  23. {
  24. return this.helpText;
  25. }
  26. }
  27. public ImageResource Image
  28. {
  29. get
  30. {
  31. return this.image;
  32. }
  33. }
  34. public bool SkipIfActiveOnHotKey
  35. {
  36. get
  37. {
  38. return this.skipIfActiveOnHotKey;
  39. }
  40. }
  41. public char HotKey
  42. {
  43. get
  44. {
  45. return this.hotKey;
  46. }
  47. }
  48. public Type ToolType
  49. {
  50. get
  51. {
  52. return this.toolType;
  53. }
  54. }
  55. public ToolBarConfigItems ToolBarConfigItems
  56. {
  57. get
  58. {
  59. return this.toolBarConfigItems;
  60. }
  61. }
  62. public override bool Equals(object obj)
  63. {
  64. ToolInfo rhs = obj as ToolInfo;
  65. if (rhs == null)
  66. {
  67. return false;
  68. }
  69. return (this.name == rhs.name) &&
  70. (this.helpText == rhs.helpText) &&
  71. (this.hotKey == rhs.hotKey) &&
  72. (this.skipIfActiveOnHotKey == rhs.skipIfActiveOnHotKey) &&
  73. (this.toolType == rhs.toolType);
  74. }
  75. public override int GetHashCode()
  76. {
  77. return name.GetHashCode();
  78. }
  79. public ToolInfo(
  80. string name,
  81. string helpText,
  82. ImageResource image,
  83. char hotKey,
  84. bool skipIfActiveOnHotKey,
  85. ToolBarConfigItems toolBarConfigItems,
  86. Type toolType)
  87. {
  88. this.name = name;
  89. this.helpText = helpText;
  90. this.image = image;
  91. this.hotKey = hotKey;
  92. this.skipIfActiveOnHotKey = skipIfActiveOnHotKey;
  93. this.toolBarConfigItems = toolBarConfigItems;
  94. this.toolType = toolType;
  95. }
  96. }
  97. }