Udostępnij przez


HealthMonitoringSection.Enabled Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy monitorowanie kondycji jest włączone.

public:
 property bool Enabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)]
public bool Enabled { get; set; }
[<System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

Wartość właściwości

true jeśli monitorowanie kondycji jest włączone; w przeciwnym razie , false. Wartość domyślna to true.

Atrybuty

Przykłady

Poniższy przykład kodu pokazuje, jak pobrać bieżącą wartość z Enabled właściwości i jak wyłączyć monitorowanie kondycji, ustawiając tę właściwość na wartość false. Ten przykład kodu jest częścią większego przykładu udostępnionego HealthMonitoringSection dla klasy .


// Get the current Enabled property value.
Boolean enabledValue = healthMonitoringSection.Enabled;

// Set the Enabled property to false.
healthMonitoringSection.Enabled = false;

' Get the current Enabled property value.
Dim enabledValue As Boolean = healthMonitoringSection.Enabled

' Set the Enabled property to False.
healthMonitoringSection.Enabled = False

Dotyczy