BufferModesCollection Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Kolekce BufferModeSettings objektů. Tato třída se nemůže dědit.
public ref class BufferModesCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.BufferModeSettings))]
public sealed class BufferModesCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.BufferModeSettings))>]
type BufferModesCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class BufferModesCollection
Inherits ConfigurationElementCollection
- Dědičnost
- Atributy
Příklady
Následující příklad kódu ukazuje, jak použít BufferModesCollection typ. Tento příklad kódu je součástí většího příkladu uvedeného pro třídu HealthMonitoringSection.
// 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()
Poznámky
Objekt BufferModeSettings se používá k definování rolí pro zprostředkovatele událostí, jako jsou kritické, oznámení, analýza a protokolování. Každá role nastavuje události režimu vyrovnávací paměti odlišně. Například kritická role udržuje MaxBufferSizeMaxFlushSize a UrgentFlushInterval vlastnosti malé, zatímco role Analýza nastaví tyto vlastnosti na vyšší hodnoty.
Konstruktory
| Name | Description |
|---|---|
| BufferModesCollection() |
Inicializuje novou instanci BufferModesCollection třídy. |
Vlastnosti
| Name | Description |
|---|---|
| AddElementName |
Získá nebo nastaví název ConfigurationElement přidružit k operaci přidání v ConfigurationElementCollection při přepsání v odvozené třídě. (Zděděno od ConfigurationElementCollection) |
| ClearElementName |
Získá nebo nastaví název pro ConfigurationElement přidružit k jasné operaci v ConfigurationElementCollection při přepsání v odvozené třídě. (Zděděno od ConfigurationElementCollection) |
| CollectionType |
Získá typ ConfigurationElementCollection. (Zděděno od ConfigurationElementCollection) |
| Count |
Získá počet prvků v kolekci. (Zděděno od ConfigurationElementCollection) |
| CurrentConfiguration |
Získá odkaz na instanci nejvyšší úrovně Configuration, která představuje hierarchii konfigurace, do které patří aktuální instance ConfigurationElement. (Zděděno od ConfigurationElement) |
| ElementInformation |
Získá ElementInformation objekt, který obsahuje neuzpůsobitelné informace a funkce ConfigurationElement objektu. (Zděděno od ConfigurationElement) |
| ElementName |
Získá název použitý k identifikaci této kolekce elementů v konfiguračním souboru při přepsání v odvozené třídě. (Zděděno od ConfigurationElementCollection) |
| ElementProperty |
Získá ConfigurationElementProperty objekt, který představuje ConfigurationElement objekt sám. (Zděděno od ConfigurationElement) |
| EmitClear |
Získá nebo nastaví hodnotu, která určuje, zda kolekce byla vymazána. (Zděděno od ConfigurationElementCollection) |
| EvaluationContext |
Získá objekt ContextInformation pro objekt ConfigurationElement. (Zděděno od ConfigurationElement) |
| HasContext |
Získá hodnotu, která určuje, zda CurrentConfiguration vlastnost je |
| IsSynchronized |
Získá hodnotu určující, zda je přístup ke kolekci synchronizován. (Zděděno od ConfigurationElementCollection) |
| Item[ConfigurationProperty] |
Získá nebo nastaví vlastnost nebo atribut tohoto elementu konfigurace. (Zděděno od ConfigurationElement) |
| Item[Int32] |
BufferModeSettings Získá objekt se zadaným číselným indexem v kolekci. |
| Item[String] |
BufferModeSettings Získá objekt na základě zadaného klíče v kolekci. |
| LockAllAttributesExcept |
Získá kolekci uzamčených atributů. (Zděděno od ConfigurationElement) |
| LockAllElementsExcept |
Získá kolekci uzamčených prvků. (Zděděno od ConfigurationElement) |
| LockAttributes |
Získá kolekci uzamčených atributů. (Zděděno od ConfigurationElement) |
| LockElements |
Získá kolekci uzamčených prvků. (Zděděno od ConfigurationElement) |
| LockItem |
Získá nebo nastaví hodnotu označující, zda je prvek uzamčen. (Zděděno od ConfigurationElement) |
| Properties |
Získá kolekci vlastností. (Zděděno od ConfigurationElement) |
| RemoveElementName |
Získá nebo nastaví název ConfigurationElement přidružit k operaci remove v ConfigurationElementCollection při přepsání v odvozené třídě. (Zděděno od ConfigurationElementCollection) |
| SyncRoot |
Získá objekt použitý k synchronizaci přístupu k ConfigurationElementCollection. (Zděděno od ConfigurationElementCollection) |
| ThrowOnDuplicate |
Získá hodnotu označující, zda pokus přidat duplicitní ConfigurationElement do ConfigurationElementCollection způsobí vyvolání výjimky. (Zděděno od ConfigurationElementCollection) |
Metody
Explicitní implementace rozhraní
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Zkopíruje ConfigurationElementCollection do pole. (Zděděno od ConfigurationElementCollection) |
Metody rozšíření
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Umožňuje paralelizaci dotazu. |
| AsQueryable(IEnumerable) |
Převede IEnumerable na IQueryable. |
| Cast<TResult>(IEnumerable) |
Přetypuje prvky IEnumerable na zadaný typ. |
| OfType<TResult>(IEnumerable) |
Filtruje prvky IEnumerable na základě zadaného typu. |