HealthMonitoringSection.BufferModes Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém uma coleção de objetos que especificam as configurações para os modos de buffer.
public:
property System::Web::Configuration::BufferModesCollection ^ BufferModes { System::Web::Configuration::BufferModesCollection ^ get(); };
[System.Configuration.ConfigurationProperty("bufferModes")]
public System.Web.Configuration.BufferModesCollection BufferModes { get; }
[<System.Configuration.ConfigurationProperty("bufferModes")>]
member this.BufferModes : System.Web.Configuration.BufferModesCollection
Public ReadOnly Property BufferModes As BufferModesCollection
Valor da propriedade
Uma coleção BufferModesCollection de objetos BufferModeSettings.
- Atributos
Exemplos
O exemplo de código a seguir mostra como usar a BufferModes propriedade. Este exemplo de código faz parte de um exemplo maior fornecido para a HealthMonitoringSection classe.
// Add a BufferModeSettings object to the BufferModes collection property.
BufferModeSettings bufferModeSetting = new BufferModeSettings("Error Log",
1024, 256, 512, new TimeSpan(0, 30, 0), new TimeSpan(0, 5, 0), 2);
bufferModeSetting.Name = "Operations Notification";
bufferModeSetting.MaxBufferSize = 128;
bufferModeSetting.MaxBufferThreads = 1;
bufferModeSetting.MaxFlushSize = 24;
bufferModeSetting.RegularFlushInterval = TimeSpan.MaxValue;
bufferModeSetting.UrgentFlushInterval = TimeSpan.Parse("00:01:00");
bufferModeSetting.UrgentFlushThreshold = 1;
healthMonitoringSection.BufferModes.Add(bufferModeSetting);
// Add a BufferModeSettings object to the BufferModes collection property.
healthMonitoringSection.BufferModes.Add(new BufferModeSettings("Error Log",
1024, 256, 512, new TimeSpan(0, 30, 0), new TimeSpan(0, 5, 0), 2));
// Display contents of the BufferModes collection property
Console.WriteLine("BufferModes Collection contains {0} values:",
healthMonitoringSection.BufferModes.Count);
// Display all elements.
for (System.Int32 i = 0; i < healthMonitoringSection.BufferModes.Count; i++)
{
bufferModeSetting = healthMonitoringSection.BufferModes[i];
string name = bufferModeSetting.Name;
int maxBufferSize = bufferModeSetting.MaxBufferSize;
int maxBufferThreads = bufferModeSetting.MaxBufferThreads;
int maxFlushSize = bufferModeSetting.MaxFlushSize;
TimeSpan regularFlushInterval = bufferModeSetting.RegularFlushInterval;
TimeSpan urgentFlushInterval = bufferModeSetting.UrgentFlushInterval;
int urgentFlushThreshold = bufferModeSetting.UrgentFlushThreshold;
string item = "Name='" + name + "', MaxBufferSize = '" + maxBufferSize +
"', MaxBufferThreads = '" + maxBufferThreads +
"', MaxFlushSize = '" + maxFlushSize +
"', RegularFlushInterval = '" + regularFlushInterval +
"', UrgentFlushInterval = '" + urgentFlushInterval +
"', UrgentFlushThreshold = '" + urgentFlushThreshold + "'";
Console.WriteLine(" Item {0}: {1}", i, item);
}
// Get a named BufferMode
bufferModeSetting = healthMonitoringSection.BufferModes["Error Log"];
// Remove a BufferModeSettings object from the BufferModes collection property.
healthMonitoringSection.BufferModes.Remove("Error Log");
// Clear all BufferModeSettings object from the BufferModes collection property.
healthMonitoringSection.BufferModes.Clear();
' Add a BufferModeSettings object to the BufferModes collection property.
Dim bufferModeSetting As BufferModeSettings = new BufferModeSettings("Error Log", _
1024, 256, 512, new TimeSpan(0, 30, 0), new TimeSpan(0, 5, 0), 2)
bufferModeSetting.Name = "Operations Notification"
bufferModeSetting.MaxBufferSize = 128
bufferModeSetting.MaxBufferThreads = 1
bufferModeSetting.MaxFlushSize = 24
bufferModeSetting.RegularFlushInterval = TimeSpan.MaxValue
bufferModeSetting.UrgentFlushInterval = TimeSpan.Parse("00:01:00")
bufferModeSetting.UrgentFlushThreshold = 1
healthMonitoringSection.BufferModes.Add(bufferModeSetting)
' Add a BufferModeSettings object to the BufferModes collection property.
healthMonitoringSection.BufferModes.Add(new BufferModeSettings("Error Log", _
1024, 256, 512, new TimeSpan(0, 30, 0), new TimeSpan(0, 5, 0), 2))
' Display contents of the BufferModes collection property
Console.WriteLine("BufferModes Collection contains {0} values:", _
healthMonitoringSection.BufferModes.Count)
' Display all elements.
For i As System.Int32 = 0 To healthMonitoringSection.BufferModes.Count - 1
bufferModeSetting = healthMonitoringSection.BufferModes(i)
Dim name As String = bufferModeSetting.Name
Dim maxBufferSize As Integer = bufferModeSetting.MaxBufferSize
Dim maxBufferThreads As Integer = bufferModeSetting.MaxBufferThreads
Dim maxFlushSize As Integer = bufferModeSetting.MaxFlushSize
Dim regularFlushInterval As TimeSpan = bufferModeSetting.RegularFlushInterval
Dim urgentFlushInterval As TimeSpan = bufferModeSetting.UrgentFlushInterval
Dim urgentFlushThreshold As Integer = bufferModeSetting.UrgentFlushThreshold
Dim item As String = "Name='" & name & "', MaxBufferSize = '" & maxBufferSize & _
"', MaxBufferThreads = '" & maxBufferThreads & _
"', MaxFlushSize = '" & maxFlushSize & _
"', RegularFlushInterval = '" & regularFlushInterval.ToString() & _
"', UrgentFlushInterval = '" & urgentFlushInterval.ToString() & _
"', UrgentFlushThreshold = '" & urgentFlushThreshold & "'"
Console.WriteLine(" Item {0}: {1}", i, item)
Next
' Get a named BufferMode
bufferModeSetting = healthMonitoringSection.BufferModes("Error Log")
' Remove a BufferModeSettings object from the BufferModes collection property.
healthMonitoringSection.BufferModes.Remove("Error Log")
' Clear all BufferModeSettings object from the BufferModes collection property.
healthMonitoringSection.BufferModes.Clear()
Comentários
Essa é uma coleção de BufferModeSettings objetos que definem a maneira como os eventos de monitoramento de integridade podem ser armazenados em buffer antes de serem gerados.
Essa propriedade usa como padrão uma coleção vazia BufferModesCollection .