JustInTimeActivationAttribute.Value 属性

定义

获取 JustInTimeActivationAttribute 设置的值。

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

属性值

如果启用 JIT 激活,则为 true;否则为 false。 默认值为 true

示例

下面的代码示例获取特性的 Value 属性的值JustInTimeActivation

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

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

适用于