MustRunInClientContextAttribute.Value Właściwość
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Pobiera wartość wskazującą, czy obiekt przypisany ma zostać utworzony w kontekście twórcy.
public:
property bool Value { bool get(); };
public bool Value { get; }
member this.Value : bool
Public ReadOnly Property Value As Boolean
Wartość właściwości
true
jeśli obiekt ma zostać utworzony w kontekście twórcy; w przeciwnym razie , false
. Wartość domyślna to true
.
Przykłady
Poniższy przykład kodu pobiera wartość MustRunInClientContext
właściwości atrybutu 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
Dotyczy
Opinia
https://aka.ms/ContentUserFeedback.
Dostępne już wkrótce: W 2024 r. będziemy stopniowo wycofywać zgłoszenia z serwisu GitHub jako mechanizm przesyłania opinii na temat zawartości i zastępować go nowym systemem opinii. Aby uzyskać więcej informacji, sprawdź:Prześlij i wyświetl opinię dla