SRDescriptionAttribute.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using System.ComponentModel;
  8. namespace FastReport.DataVisualization.Charting
  9. {
  10. [AttributeUsage(AttributeTargets.All)]
  11. internal sealed class SRDescriptionAttribute : DescriptionAttribute
  12. {
  13. // Fields
  14. private bool replaced;
  15. // Methods
  16. public SRDescriptionAttribute(string description)
  17. : base(description)
  18. {
  19. }
  20. // Properties
  21. public override string Description
  22. {
  23. get
  24. {
  25. if (!this.replaced)
  26. {
  27. this.replaced = true;
  28. base.DescriptionValue = SR.Keys.GetString(base.Description);
  29. }
  30. return base.Description;
  31. }
  32. }
  33. }
  34. }