PageRenderTime 35ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/stable-1.1.1/Client/Settings/SettingDescriptionAttribute.cs

#
C# | 37 lines | 21 code | 8 blank | 8 comment | 1 complexity | 20cb3f7da24eeddfef98590a7564cd2b MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. //-----------------------------------------------------------------------
  2. // <copyright>
  3. // Copyright (C) Ruslan Yakushev for the PHP Manager for IIS project.
  4. //
  5. // This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
  6. // See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
  7. // </copyright>
  8. //-----------------------------------------------------------------------
  9. using System;
  10. using System.ComponentModel;
  11. namespace Web.Management.PHP.Settings
  12. {
  13. [AttributeUsage(AttributeTargets.Property| AttributeTargets.Event|AttributeTargets.Class)]
  14. internal sealed class SettingDescriptionAttribute : DescriptionAttribute {
  15. private bool _replaced;
  16. internal SettingDescriptionAttribute(string description)
  17. : base(description) {
  18. }
  19. public override string Description {
  20. get {
  21. if (!_replaced) {
  22. _replaced = true;
  23. DescriptionValue = Resources.ResourceManager.GetString(base.Description);
  24. }
  25. return base.Description;
  26. }
  27. }
  28. }
  29. }