PageRenderTime 27ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/Project/Src/AddIns/ReSharper/QuickFixes/Documentation/SA1629QuickFix.cs

#
C# | 117 lines | 43 code | 15 blank | 59 comment | 0 complexity | 8ae4f545839c498d0d4b2a994b4692e7 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="SA1629QuickFix.cs" company="http://stylecop.codeplex.com">
  3. // MS-PL
  4. // </copyright>
  5. // <license>
  6. // This source code is subject to terms and conditions of the Microsoft
  7. // Public License. A copy of the license can be found in the License.html
  8. // file at the root of this distribution. If you cannot locate the
  9. // Microsoft Public License, please send an email to dlr@microsoft.com.
  10. // By using this source code in any fashion, you are agreeing to be bound
  11. // by the terms of the Microsoft Public License. You must not remove this
  12. // notice, or any other, from this software.
  13. // </license>
  14. // <summary>
  15. // QuickFix - SA1629: DocumentationTextMustEndWithAPeriod.
  16. // </summary>
  17. // --------------------------------------------------------------------------------------------------------------------
  18. namespace StyleCop.ReSharper.QuickFixes.Documentation
  19. {
  20. #region Using Directives
  21. using System.Collections.Generic;
  22. using JetBrains.ReSharper.Feature.Services.Bulbs;
  23. using StyleCop.ReSharper.BulbItems.Documentation;
  24. using StyleCop.ReSharper.QuickFixes.Framework;
  25. using StyleCop.ReSharper.Violations;
  26. #endregion
  27. /// <summary>
  28. /// QuickFix - SA1629: DocumentationTextMustEndWithAPeriod.
  29. /// </summary>
  30. [ShowQuickFix]
  31. [QuickFix]
  32. public class SA1629QuickFix : QuickFixBase
  33. {
  34. #region Constructors and Destructors
  35. /// <summary>
  36. /// Initializes a new instance of the SA1629QuickFix class that can
  37. /// handle <see cref="StyleCopViolationError"/>.
  38. /// </summary>
  39. /// <param name="highlight">
  40. /// <see cref="StyleCopViolationError"/>that has been detected.
  41. /// </param>
  42. public SA1629QuickFix(StyleCopViolationError highlight)
  43. : base(highlight)
  44. {
  45. }
  46. /// <summary>
  47. /// Initializes a new instance of the SA1629QuickFix class that can handle
  48. /// <see cref="StyleCopViolationHint"/>.
  49. /// </summary>
  50. /// <param name="highlight">
  51. /// <see cref="StyleCopViolationHint"/>that has been detected.
  52. /// </param>
  53. public SA1629QuickFix(StyleCopViolationHint highlight)
  54. : base(highlight)
  55. {
  56. }
  57. /// <summary>
  58. /// Initializes a new instance of the SA1629QuickFix class that can handle
  59. /// <see cref="StyleCopViolationInfo"/>.
  60. /// </summary>
  61. /// <param name="highlight">
  62. /// <see cref="StyleCopViolationInfo"/>that has been detected.
  63. /// </param>
  64. public SA1629QuickFix(StyleCopViolationInfo highlight)
  65. : base(highlight)
  66. {
  67. }
  68. /// <summary>
  69. /// Initializes a new instance of the SA1629QuickFix class that can handle
  70. /// <see cref="StyleCopViolationSuggestion"/>.
  71. /// </summary>
  72. /// <param name="highlight">
  73. /// <see cref="StyleCopViolationSuggestion"/>that has been detected.
  74. /// </param>
  75. public SA1629QuickFix(StyleCopViolationSuggestion highlight)
  76. : base(highlight)
  77. {
  78. }
  79. /// <summary>
  80. /// Initializes a new instance of the SA1629QuickFix class that can handle
  81. /// <see cref="StyleCopViolationWarning"/>.
  82. /// </summary>
  83. /// <param name="highlight">
  84. /// <see cref="StyleCopViolationWarning"/>that has been detected.
  85. /// </param>
  86. public SA1629QuickFix(StyleCopViolationWarning highlight)
  87. : base(highlight)
  88. {
  89. }
  90. #endregion
  91. #region Methods
  92. /// <summary>
  93. /// Initialises the QuickFix with all the available BulbItems that can fix the current
  94. /// StyleCop Violation.
  95. /// </summary>
  96. protected override void InitialiseBulbItems()
  97. {
  98. this.BulbItems = new List<IBulbItem> { new SA1629DocumentationTextMustEndWithAPeriodBulbItem { Description = "Documentation text must end with a '.' : " + this.Violation.ToolTip } };
  99. }
  100. #endregion
  101. }
  102. }