Share via


MustRunInClientContextAttribute.Value 속성

정의

특성을 사용하는 개체가 작성자의 컨텍스트에서 만들어지는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool Value { bool get(); };
public bool Value { get; }
member this.Value : bool
Public ReadOnly Property Value As Boolean

속성 값

작성자의 컨텍스트에서 개체가 만들어지면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 코드 예제에서는 값을 가져옵니다를 MustRunInClientContext 특성의 Value 속성입니다.

[MustRunInClientContext(false)]
public class MustRunInClientContextAttribute_Value : ServicedComponent
{
    public void ValueExample()
    {
        // Get the MustRunInClientContextAttribute applied to the class.
        MustRunInClientContextAttribute attribute =
            (MustRunInClientContextAttribute)Attribute.GetCustomAttribute(
            this.GetType(),
            typeof(MustRunInClientContextAttribute),
            false);

        // Display the value of the attribute's Value property.
        Console.WriteLine("MustRunInClientContextAttribute.Value: {0}",
            attribute.Value);
    }
}
<MustRunInClientContext(False)>  _
Public Class MustRunInClientContextAttribute_Value
    Inherits ServicedComponent
    
    Public Sub ValueExample() 
        ' Get the MustRunInClientContextAttribute applied to the class.
        Dim attribute As MustRunInClientContextAttribute = CType(Attribute.GetCustomAttribute(Me.GetType(), GetType(MustRunInClientContextAttribute), False), MustRunInClientContextAttribute)
        
        ' Display the value of the attribute's Value property.
        MsgBox("MustRunInClientContextAttribute.Value: " & attribute.Value)
    
    End Sub
End Class

적용 대상