BufferModesCollection Klasa
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.
Kolekcja BufferModeSettings obiektów. Klasa ta nie może być dziedziczona.
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
- Dziedziczenie
- Atrybuty
Przykłady
W poniższym przykładzie kodu pokazano, jak używać BufferModesCollection typu. Ten przykład kodu jest częścią większego przykładu udostępnionego dla klasy 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()
Uwagi
Obiekt BufferModeSettings służy do definiowania ról dla dostawców zdarzeń, takich jak Krytyczne, Powiadomienie, Analiza i Rejestrowanie. Każda rola ustawia zdarzenia trybu buforowania inaczej. Na przykład rola Krytyczna zachowuje MaxBufferSizewłaściwości i MaxFlushSizeUrgentFlushInterval małe, natomiast rola Analiza ustawia te właściwości na wyższe wartości.
Konstruktory
| Nazwa | Opis |
|---|---|
| BufferModesCollection() |
Inicjuje nowe wystąpienie klasy BufferModesCollection. |
Właściwości
| Nazwa | Opis |
|---|---|
| AddElementName |
Pobiera lub ustawia nazwę ConfigurationElement do skojarzenia z operacją dodawania w ConfigurationElementCollection podczas zastępowania w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| ClearElementName |
Pobiera lub ustawia nazwę ConfigurationElement do skojarzenia z operacją clear w ConfigurationElementCollection po zastąpieniu w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| CollectionType |
Pobiera typ ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| Count |
Pobiera liczbę elementów w kolekcji. (Odziedziczone po ConfigurationElementCollection) |
| CurrentConfiguration |
Pobiera odwołanie do wystąpienia najwyższego poziomu Configuration, które reprezentuje hierarchię konfiguracji, do którego należy bieżące wystąpienie ConfigurationElement. (Odziedziczone po ConfigurationElement) |
| ElementInformation |
Pobiera obiekt ElementInformation zawierający informacje i funkcje obiektu ConfigurationElement, które nie można dostosowywać. (Odziedziczone po ConfigurationElement) |
| ElementName |
Pobiera nazwę używaną do identyfikowania tej kolekcji elementów w pliku konfiguracji podczas zastępowania w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| ElementProperty |
Pobiera obiekt ConfigurationElementProperty reprezentujący sam obiekt ConfigurationElement. (Odziedziczone po ConfigurationElement) |
| EmitClear |
Pobiera lub ustawia wartość określającą, czy kolekcja została wyczyszczone. (Odziedziczone po ConfigurationElementCollection) |
| EvaluationContext |
Pobiera obiekt ContextInformation dla obiektu ConfigurationElement. (Odziedziczone po ConfigurationElement) |
| HasContext |
Pobiera wartość wskazującą, czy właściwość CurrentConfiguration jest |
| IsSynchronized |
Pobiera wartość wskazującą, czy dostęp do kolekcji jest synchronizowany. (Odziedziczone po ConfigurationElementCollection) |
| Item[ConfigurationProperty] |
Pobiera lub ustawia właściwość lub atrybut tego elementu konfiguracji. (Odziedziczone po ConfigurationElement) |
| Item[Int32] |
BufferModeSettings Pobiera obiekt z określonym indeksem liczbowym w kolekcji. |
| Item[String] |
BufferModeSettings Pobiera obiekt na podstawie określonego klucza w kolekcji. |
| LockAllAttributesExcept |
Pobiera kolekcję zablokowanych atrybutów. (Odziedziczone po ConfigurationElement) |
| LockAllElementsExcept |
Pobiera kolekcję zablokowanych elementów. (Odziedziczone po ConfigurationElement) |
| LockAttributes |
Pobiera kolekcję zablokowanych atrybutów. (Odziedziczone po ConfigurationElement) |
| LockElements |
Pobiera kolekcję zablokowanych elementów. (Odziedziczone po ConfigurationElement) |
| LockItem |
Pobiera lub ustawia wartość wskazującą, czy element jest zablokowany. (Odziedziczone po ConfigurationElement) |
| Properties |
Pobiera kolekcję właściwości. (Odziedziczone po ConfigurationElement) |
| RemoveElementName |
Pobiera lub ustawia nazwę ConfigurationElement do skojarzenia z operacją usuwania w ConfigurationElementCollection po zastąpieniu w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| SyncRoot |
Pobiera obiekt używany do synchronizowania dostępu do ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| ThrowOnDuplicate |
Pobiera wartość wskazującą, czy próba dodania zduplikowanego ConfigurationElement do ConfigurationElementCollection spowoduje zgłoszenie wyjątku. (Odziedziczone po ConfigurationElementCollection) |
Metody
| Nazwa | Opis |
|---|---|
| Add(BufferModeSettings) |
BufferModeSettings Dodaje obiekt do kolekcji. |
| BaseAdd(ConfigurationElement, Boolean) |
Dodaje element konfiguracji do kolekcji elementów konfiguracji. (Odziedziczone po ConfigurationElementCollection) |
| BaseAdd(ConfigurationElement) |
Dodaje element konfiguracji do ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| BaseAdd(Int32, ConfigurationElement) |
Dodaje element konfiguracji do kolekcji elementów konfiguracji. (Odziedziczone po ConfigurationElementCollection) |
| BaseClear() |
Usuwa wszystkie obiekty elementów konfiguracji z kolekcji. (Odziedziczone po ConfigurationElementCollection) |
| BaseGet(Int32) |
Pobiera element konfiguracji w określonej lokalizacji indeksu. (Odziedziczone po ConfigurationElementCollection) |
| BaseGet(Object) |
Zwraca element konfiguracji z określonym kluczem. (Odziedziczone po ConfigurationElementCollection) |
| BaseGetAllKeys() |
Zwraca tablicę kluczy dla wszystkich elementów konfiguracji zawartych w ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| BaseGetKey(Int32) |
Pobiera klucz dla ConfigurationElement w określonej lokalizacji indeksu. (Odziedziczone po ConfigurationElementCollection) |
| BaseIndexOf(ConfigurationElement) |
Wskazuje indeks określonego ConfigurationElement. (Odziedziczone po ConfigurationElementCollection) |
| BaseIsRemoved(Object) |
Wskazuje, czy ConfigurationElement z określonym kluczem został usunięty z ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| BaseRemove(Object) |
Usuwa ConfigurationElement z kolekcji. (Odziedziczone po ConfigurationElementCollection) |
| BaseRemoveAt(Int32) |
Usuwa ConfigurationElement w określonej lokalizacji indeksu. (Odziedziczone po ConfigurationElementCollection) |
| Clear() |
Usuwa wszystkie BufferModeSettings obiekty z kolekcji. |
| CopyTo(ConfigurationElement[], Int32) |
Kopiuje zawartość ConfigurationElementCollection do tablicy. (Odziedziczone po ConfigurationElementCollection) |
| CreateNewElement() |
Po zastąpieniu w klasie pochodnej tworzy nowy ConfigurationElementelement . (Odziedziczone po ConfigurationElementCollection) |
| CreateNewElement(String) |
Tworzy nowy ConfigurationElement podczas zastępowania w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| DeserializeElement(XmlReader, Boolean) |
Odczytuje kod XML z pliku konfiguracji. (Odziedziczone po ConfigurationElement) |
| Equals(Object) |
Porównuje ConfigurationElementCollection z określonym obiektem. (Odziedziczone po ConfigurationElementCollection) |
| GetElementKey(ConfigurationElement) |
Pobiera klucz elementu dla określonego elementu konfiguracji podczas zastępowania w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| GetEnumerator() |
Pobiera element IEnumerator używany do iterowania przez element ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| GetHashCode() |
Pobiera unikatową wartość reprezentującą wystąpienie ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| GetTransformedAssemblyString(String) |
Zwraca przekształconą wersję określonej nazwy zestawu. (Odziedziczone po ConfigurationElement) |
| GetTransformedTypeString(String) |
Zwraca przekształconą wersję określonej nazwy typu. (Odziedziczone po ConfigurationElement) |
| GetType() |
Pobiera Type bieżącego wystąpienia. (Odziedziczone po Object) |
| Init() |
Ustawia obiekt ConfigurationElement na stan początkowy. (Odziedziczone po ConfigurationElement) |
| InitializeDefault() |
Służy do inicjowania domyślnego zestawu wartości dla obiektu ConfigurationElement. (Odziedziczone po ConfigurationElement) |
| IsElementName(String) |
Wskazuje, czy określony ConfigurationElement istnieje w ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| IsElementRemovable(ConfigurationElement) |
Wskazuje, czy można usunąć określony ConfigurationElement z ConfigurationElementCollection. (Odziedziczone po ConfigurationElementCollection) |
| IsModified() |
Wskazuje, czy ta ConfigurationElementCollection została zmodyfikowana od czasu ostatniego zapisania lub załadowania podczas zastępowania w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| IsReadOnly() |
Wskazuje, czy obiekt ConfigurationElementCollection jest tylko do odczytu. (Odziedziczone po ConfigurationElementCollection) |
| ListErrors(IList) |
Dodaje błędy nieprawidłowej właściwości w tym obiekcie ConfigurationElement i we wszystkich elementach podrzędnych do przekazanej listy. (Odziedziczone po ConfigurationElement) |
| MemberwiseClone() |
Tworzy płytkią kopię bieżącego Object. (Odziedziczone po Object) |
| OnDeserializeUnrecognizedAttribute(String, String) |
Pobiera wartość wskazującą, czy podczas deserializacji napotkano nieznany atrybut. (Odziedziczone po ConfigurationElement) |
| OnDeserializeUnrecognizedElement(String, XmlReader) |
Powoduje, że system konfiguracji zgłasza wyjątek. (Odziedziczone po ConfigurationElementCollection) |
| OnRequiredPropertyNotFound(String) |
Zgłasza wyjątek, gdy nie można odnaleźć wymaganej właściwości. (Odziedziczone po ConfigurationElement) |
| PostDeserialize() |
Wywoływana po deserializacji. (Odziedziczone po ConfigurationElement) |
| PreSerialize(XmlWriter) |
Wywoływana przed serializacji. (Odziedziczone po ConfigurationElement) |
| Remove(String) |
Usuwa BufferModeSettings obiekt z kolekcji. |
| Reset(ConfigurationElement) |
Resetuje ConfigurationElementCollection do stanu niezmodyfikowanego podczas zastępowania w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| ResetModified() |
Resetuje wartość właściwości IsModified(), aby |
| SerializeElement(XmlWriter, Boolean) |
Zapisuje dane konfiguracji do elementu XML w pliku konfiguracji po zastąpieniu w klasie pochodnej. (Odziedziczone po ConfigurationElementCollection) |
| SerializeToXmlElement(XmlWriter, String) |
Zapisuje zewnętrzne tagi tego elementu konfiguracji do pliku konfiguracji po zaimplementowaniu w klasie pochodnej. (Odziedziczone po ConfigurationElement) |
| SetPropertyValue(ConfigurationProperty, Object, Boolean) |
Ustawia właściwość na określoną wartość. (Odziedziczone po ConfigurationElement) |
| SetReadOnly() |
Ustawia właściwość IsReadOnly() dla obiektu ConfigurationElementCollection i dla wszystkich elementów podrzędnych. (Odziedziczone po ConfigurationElementCollection) |
| ToString() |
Zwraca ciąg reprezentujący bieżący obiekt. (Odziedziczone po Object) |
| Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode) |
Odwraca efekt scalania informacji o konfiguracji z różnych poziomów hierarchii konfiguracji. (Odziedziczone po ConfigurationElementCollection) |
Jawne implementacje interfejsu
| Nazwa | Opis |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopiuje ConfigurationElementCollection do tablicy. (Odziedziczone po ConfigurationElementCollection) |
Metody rozszerzania
| Nazwa | Opis |
|---|---|
| AsParallel(IEnumerable) |
Umożliwia równoległość zapytania. |
| AsQueryable(IEnumerable) |
Konwertuje IEnumerable na IQueryable. |
| Cast<TResult>(IEnumerable) |
Rzutuje elementy IEnumerable do określonego typu. |
| OfType<TResult>(IEnumerable) |
Filtruje elementy IEnumerable na podstawie określonego typu. |