HealthMonitoringSection.Providers Właściwość

Definicja

ProviderSettingsCollection Pobiera kolekcję ProviderSettings obiektów.

public:
 property System::Configuration::ProviderSettingsCollection ^ Providers { System::Configuration::ProviderSettingsCollection ^ get(); };
[System.Configuration.ConfigurationProperty("providers")]
public System.Configuration.ProviderSettingsCollection Providers { get; }
[<System.Configuration.ConfigurationProperty("providers")>]
member this.Providers : System.Configuration.ProviderSettingsCollection
Public ReadOnly Property Providers As ProviderSettingsCollection

Wartość właściwości

ProviderSettingsCollection Kolekcja. Wartość domyślna to pusta ProviderSettingsCollection kolekcja.

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak używać Providers właściwości . Ten przykład kodu jest częścią większego przykładu udostępnionego HealthMonitoringSection dla klasy .


// Display contents of the Providers collection property
Console.WriteLine("Providers Collection contains {0} values:", 
    healthMonitoringSection.Providers.Count);

// Display all elements.
for (System.Int32 i = 0; i < healthMonitoringSection.Providers.Count; i++)
{
    System.Configuration.ProviderSettings provider = 
        healthMonitoringSection.Providers[i];
    Console.WriteLine("  Item {0}: Name = '{1}' Type = '{2}'", i, 
        provider.Name, provider.Type);
}

' Display contents of the Providers collection property
Console.WriteLine("Providers Collection contains {0} values:", _
    healthMonitoringSection.Providers.Count)

' Display all elements.
For i As System.Int32 = 0 To healthMonitoringSection.Providers.Count - 1
    Dim providerStg As System.Configuration.ProviderSettings = _
        healthMonitoringSection.Providers(i)
    Console.WriteLine("  Item {0}: Name = '{1}' Type = '{2}'", i, _
        providerStg.Name, providerStg.Type)
Next

Uwagi

Właściwość Providers określa, który dostawca jest używany dla którego ze zdarzeń zdefiniowanych we EventMappings właściwości.

Dotyczy

Zobacz też