I have recently been working on some web parts for a site hosted on a SharePoint 2007 (aka MOSS 2007). I was unable to get the custom properties to work. Paul Stork was kind enough to provide the answer. Apparently the method declaration changed between SharePoint 2003 and 2007. The reference that I had found was for the older version.
Old Version (2003)
private const string defaultText = "John";
private string text = defaultText;
Browsable(true),
Category("Test"),
DefaultValue(defaultText),
WebPartStorage(Storage.Shared),
FriendlyName("Text"),
Description("Text Property")]
public string Text
{
get { return text; }
set { text = value; }
}
MOSS 2007 custom Properties
[System.Web.UI.WebControls.WebParts.WebBrowsable(true)
,System.Web.UI.WebControls.WebParts.WebDisplayName("Text Prop Name")
,System.Web.UI.WebControls.WebParts.WebDescription("Text Prop Tooltip")
,System.Web.UI.WebControls.WebParts.Personalizable( System.Web.UI.WebControls.WebParts.PersonalizationScope.User)
,System.ComponentModel.Category("Todd Parts")
, System.ComponentModel.DefaultValue(DEFAULT_TEXT_PROP)]
public string TextProp
{
get { return _textProp; }
set { _textProp = value; }
}