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 
5 namespace System.DirectoryServices
6 {
7     using System;
8     using System.ComponentModel;
9 
10     /// <include file='doc\DirectoryDescriptionAttribute.uex' path='docs/doc[@for="DSDescriptionAttribute"]/*' />
11     /// <internalonly/>
12     /// <devdoc>
13     ///    <para>DescriptionAttribute marks a property, event, or extender with a
14     ///       description. Visual designers can display this description when referencing
15     ///       the member.</para>
16     /// </devdoc>
17     [AttributeUsage(AttributeTargets.All)]
18     public class DSDescriptionAttribute : DescriptionAttribute
19     {
20         private bool _replaced = false;
21 
22         /// <include file='doc\DirectoryDescriptionAttribute.uex' path='docs/doc[@for="DSDescriptionAttribute.DSDescriptionAttribute"]/*' />
23         /// <devdoc>
24         ///     Constructs a new sys description.
25         /// </devdoc>
DSDescriptionAttribute(string description)26         public DSDescriptionAttribute(string description) : base(description)
27         {
28         }
29 
30         /// <include file='doc\DirectoryDescriptionAttribute.uex' path='docs/doc[@for="DSDescriptionAttribute.Description"]/*' />
31         /// <devdoc>
32         ///     Retrieves the description text.
33         /// </devdoc>
34         public override string Description
35         {
36             get
37             {
38                 if (!_replaced)
39                 {
40                     _replaced = true;
41                     DescriptionValue = Res.GetString(base.Description);
42                 }
43                 return base.Description;
44             }
45         }
46     }
47 }
48