PageRenderTime 105ms CodeModel.GetById 100ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
C# | 37 lines | 21 code | 8 blank | 8 comment | 1 complexity | 20cb3f7da24eeddfef98590a7564cd2b MD5 | raw file
 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
10using System;
11using System.ComponentModel;
12
13namespace Web.Management.PHP.Settings
14{
15    
16    [AttributeUsage(AttributeTargets.Property| AttributeTargets.Event|AttributeTargets.Class)]
17    internal sealed class SettingDescriptionAttribute : DescriptionAttribute {
18
19        private bool _replaced;
20
21        internal SettingDescriptionAttribute(string description)
22            : base(description) {
23        }
24
25        public override string Description {
26            get {
27                if (!_replaced) {
28                    _replaced = true;
29                    DescriptionValue = Resources.ResourceManager.GetString(base.Description);
30                }
31
32                return base.Description;
33            }
34        }
35
36    }
37}