1 //------------------------------------------------------------------------------
2 // <copyright file="WebPartHelpVerb.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6 
7 namespace System.Web.UI.WebControls.WebParts {
8 
9     using System;
10 
11     internal sealed class WebPartHelpVerb : WebPartActionVerb {
12 
13         private string _defaultDescription;
14         private string _defaultText;
15 
16         private string DefaultDescription {
17             get {
18                 if (_defaultDescription == null) {
19                     _defaultDescription = SR.GetString(SR.WebPartHelpVerb_Description);
20                 }
21                 return _defaultDescription;
22             }
23         }
24 
25         private string DefaultText {
26             get {
27                 if (_defaultText == null) {
28                     _defaultText = SR.GetString(SR.WebPartHelpVerb_Text);
29                 }
30                 return _defaultText;
31             }
32         }
33 
34         // Properties must look at viewstate directly instead of the property in the base class,
35         // so we can distinguish between an unset property and a property set to String.Empty.
36         [
37         WebSysDefaultValue(SR.WebPartHelpVerb_Description)
38         ]
39         public override string Description {
40             get {
41                 object o = ViewState["Description"];
42                 return (o == null) ? DefaultDescription : (string)o;
43             }
44             set {
45                 ViewState["Description"] = value;
46             }
47         }
48 
49         [
50         WebSysDefaultValue(SR.WebPartHelpVerb_Text)
51         ]
52         public override string Text {
53             get {
54                 object o = ViewState["Text"];
55                 return (o == null) ? DefaultText : (string)o;
56             }
57             set {
58                 ViewState["Text"] = value;
59             }
60         }
61     }
62 }
63