ConfigurationPropertyAttribute.DefaultValue 속성
정의
데코레이팅된 속성의 기본값을 가져오거나 설정합니다.Gets or sets the default value for the decorated property.
public:
property System::Object ^ DefaultValue { System::Object ^ get(); void set(System::Object ^ value); };
public object DefaultValue { get; set; }
member this.DefaultValue : obj with get, set
Public Property DefaultValue As Object
속성 값
데코레이팅된 구성 요소 속성의 기본값을 나타내는 개체입니다.The object representing the default value of the decorated configuration-element property.
예제
다음 예제에서는 DefaultValue 속성을 사용하는 방법을 보여 줍니다.The following example shows how to use the DefaultValue property.
[ConfigurationProperty("url", DefaultValue = "http://www.contoso.com",
IsRequired = true)]
[RegexStringValidator(@"\w+:\/\/[\w.]+\S*")]
public string Url
{
get
{
return (string)this["url"];
}
set
{
this["url"] = value;
}
}
<ConfigurationProperty("url", DefaultValue:="http://www.contoso.com", IsRequired:=True), RegexStringValidator("\w+:\/\/[\w.]+\S*")>
Public Property Url() As String
Get
Return CStr(Me("url"))
End Get
Set(ByVal value As String)
Me("url") = value
End Set
End Property