RuleSettingsCollection Třída

Definice

Kolekce objektů RuleSettings. Tuto třídu nelze zdědit.

public ref class RuleSettingsCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.RuleSettings))]
public sealed class RuleSettingsCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.RuleSettings))>]
type RuleSettingsCollection = class
    inherit ConfigurationElementCollection
Public NotInheritable Class RuleSettingsCollection
Inherits ConfigurationElementCollection
Dědičnost
Atributy

Příklady

Následující příklad kódu ukazuje, jak použít RuleSettingsCollection typ. Tento příklad kódu je součástí většího příkladu poskytnutého HealthMonitoringSection pro třídu.


// Add a RuleSettings object to the Rules collection property.
RuleSettings ruleSetting = new RuleSettings("All Errors Default",
    "All Errors", "EventLogProvider");
ruleSetting.Name = "All Errors Custom";
ruleSetting.EventName = "All Errors";
ruleSetting.Provider = "EventLogProvider";
ruleSetting.Profile = "Custom";
ruleSetting.MaxLimit = Int32.MaxValue;
ruleSetting.MinInstances = 1;
ruleSetting.MinInterval = TimeSpan.Parse("00:00:30");
ruleSetting.Custom = "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll";
healthMonitoringSection.Rules.Add(ruleSetting);

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("All Errors Default", 
    "All Errors", "EventLogProvider"));

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Default",
    "Failure Audits", "EventLogProvider", "Default", 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0)));

// Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Custom",
    "Failure Audits", "EventLogProvider", "Custom", 1, Int32.MaxValue,
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"));

// Insert an RuleSettings object into the Rules collection property.
healthMonitoringSection.Rules.Insert(1,
    new RuleSettings("All Errors Default2",
        "All Errors", "EventLogProvider"));

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

// Display all elements.
for (System.Int32 i = 0; i < healthMonitoringSection.Rules.Count; i++)
{
ruleSetting = healthMonitoringSection.Rules[i];
string name = ruleSetting.Name;
string eventName = ruleSetting.EventName;
string provider = ruleSetting.Provider;
string profile = ruleSetting.Profile;
int minInstances = ruleSetting.MinInstances;
int maxLimit = ruleSetting.MaxLimit;
TimeSpan minInterval = ruleSetting.MinInterval;
string custom = ruleSetting.Custom;
    string item = "Name='" + name + "', EventName='" + eventName +
        "', Provider =  '" + provider + "', Profile =  '" + profile +
        "', MinInstances =  '" + minInstances + "', MaxLimit =  '" + maxLimit +
        "', MinInterval =  '" + minInterval + "', Custom =  '" + custom + "'";
    Console.WriteLine("  Item {0}: {1}", i, item);
}

// See if the Rules collection property contains the RuleSettings 'All Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default': {0}.",
    healthMonitoringSection.Rules.Contains("All Errors Default"));

// Get the index of the 'All Errors Default' RuleSettings in the Rules collection property.
Console.WriteLine("EventMappings index for 'All Errors Default': {0}.",
    healthMonitoringSection.Rules.IndexOf("All Errors Default"));

// Get a named RuleSettings
ruleSetting = healthMonitoringSection.Rules["All Errors Default"];

// Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Remove("All Errors Default");

// Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.RemoveAt(0);

// Clear all RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Clear();

' Add a RuleSettings object to the Rules collection property.
Dim ruleSetting As RuleSettings = new RuleSettings("All Errors Default", _
    "All Errors", "EventLogProvider")
ruleSetting.Name = "All Errors Custom"
ruleSetting.EventName = "All Errors"
ruleSetting.Provider = "EventLogProvider"
ruleSetting.Profile = "Custom"
ruleSetting.MaxLimit = Int32.MaxValue
ruleSetting.MinInstances = 1
ruleSetting.MinInterval = TimeSpan.Parse("00:00:30")
ruleSetting.Custom = "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"
healthMonitoringSection.Rules.Add(ruleSetting)

' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("All Errors Default", _
    "All Errors", "EventLogProvider"))

' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Default", _
    "Failure Audits", "EventLogProvider", "Default", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0)))

' Add a RuleSettings object to the Rules collection property.
healthMonitoringSection.Rules.Add(new RuleSettings("Failure Audits Custom", _
    "Failure Audits", "EventLogProvider", "Custom", 1, Int32.MaxValue, _
    new TimeSpan(0, 1, 0), "MyEvaluators.MyCustomeEvaluator2, MyCustom.dll"))

' Insert an RuleSettings object into the Rules collection property.
healthMonitoringSection.Rules.Insert(1, _
    new RuleSettings("All Errors Default2", _
        "All Errors", "EventLogProvider"))

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

' Display all elements.
For i As System.Int32 = 0 To healthMonitoringSection.Rules.Count -1
ruleSetting = healthMonitoringSection.Rules(i)
Dim name As String = ruleSetting.Name
Dim eventName As String = ruleSetting.EventName
Dim provider As String = ruleSetting.Provider
Dim profile As String = ruleSetting.Profile
Dim minInstances As Integer = ruleSetting.MinInstances
Dim maxLimit As Integer = ruleSetting.MaxLimit
Dim minInterval As TimeSpan = ruleSetting.MinInterval
Dim custom As String = ruleSetting.Custom
    Dim item As String = "Name='" & name & "', EventName='" & eventName & _
        "', Provider =  '" & provider & "', Profile =  '" & profile & _
        "', MinInstances =  '" & minInstances & "', MaxLimit =  '" & maxLimit & _
        "', MinInterval =  '" & minInterval.ToString() & "', Custom =  '" & custom & "'"
    Console.WriteLine("  Item {0}: {1}", i, item)
Next

' See if the Rules collection property contains the RuleSettings 'All Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default': {0}.", _
    healthMonitoringSection.Rules.Contains("All Errors Default"))

' Get the index of the 'All Errors Default' RuleSettings in the Rules collection property.
Console.WriteLine("EventMappings index for 'All Errors Default': {0}.", _
    healthMonitoringSection.Rules.IndexOf("All Errors Default"))

' Get a named RuleSettings
ruleSetting = healthMonitoringSection.Rules("All Errors Default")

' Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Remove("All Errors Default")

' Remove a RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.RemoveAt(0)

' Clear all RuleSettings object from the Rules collection property.
healthMonitoringSection.Rules.Clear()

Poznámky

RuleSettings objekty se používají k definování pravidel událostí.

Konstruktory

RuleSettingsCollection()

Inicializuje novou instanci RuleSettingsCollection třídy.

Vlastnosti

AddElementName

Získá nebo nastaví název ConfigurationElement pro přidružení k operaci přidání v při přepsání v ConfigurationElementCollection odvozené třídě.

(Zděděno od ConfigurationElementCollection)
ClearElementName

Získá nebo nastaví název pro ConfigurationElement přidružení 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 elementů v kolekci.

(Zděděno od ConfigurationElementCollection)
CurrentConfiguration

Získá odkaz na instanci nejvyšší úrovně Configuration , která představuje hierarchii konfigurace, do které aktuální ConfigurationElement instance patří.

(Zděděno od ConfigurationElement)
ElementInformation

ElementInformation Získá objekt, který obsahuje neuzpůsobitelné informace a funkce objektuConfigurationElement.

(Zděděno od ConfigurationElement)
ElementName

Získá název použitý k identifikaci této kolekce prvků v konfiguračním souboru při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
ElementProperty

ConfigurationElementProperty Získá objekt, který představuje ConfigurationElement samotný objekt.

(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

ContextInformation Získá objekt objektuConfigurationElement.

(Zděděno od ConfigurationElement)
HasContext

Získá hodnotu, která označuje, zda CurrentConfiguration je nullvlastnost .

(Zděděno od ConfigurationElement)
IsSynchronized

Získá hodnotu určující, zda je přístup k kolekci synchronizován.

(Zděděno od ConfigurationElementCollection)
Item[ConfigurationProperty]

Získá nebo nastaví vlastnost nebo atribut tohoto konfiguračního prvku.

(Zděděno od ConfigurationElement)
Item[Int32]

RuleSettings Získá objekt v zadaném číselném indexu.

Item[String]

RuleSettings 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 urč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 pro přidružení 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 objektu ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
ThrowOnDuplicate

Získá hodnotu určující, zda se pokus o přidání duplicitního ConfigurationElement souboru do objektu ConfigurationElementCollection způsobí vyvolání výjimky.

(Zděděno od ConfigurationElementCollection)

Metody

Add(RuleSettings)

RuleSettings Přidá objekt do kolekce.

BaseAdd(ConfigurationElement)

Přidá do objektu ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Přidá element konfigurace do kolekce elementů konfigurace.

(Zděděno od ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Přidá element konfigurace do kolekce elementů konfigurace.

(Zděděno od ConfigurationElementCollection)
BaseClear()

Odebere všechny objekty elementů konfigurace z kolekce.

(Zděděno od ConfigurationElementCollection)
BaseGet(Int32)

Získá konfigurační prvek v zadaném umístění indexu.

(Zděděno od ConfigurationElementCollection)
BaseGet(Object)

Vrátí element konfigurace se zadaným klíčem.

(Zděděno od ConfigurationElementCollection)
BaseGetAllKeys()

Vrátí pole klíčů pro všechny prvky konfigurace obsažené v objektu ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
BaseGetKey(Int32)

Získá klíč pro zadané umístění indexu ConfigurationElement .

(Zděděno od ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Určuje index zadaného ConfigurationElementparametru .

(Zděděno od ConfigurationElementCollection)
BaseIsRemoved(Object)

Určuje, zda ConfigurationElement byl ze zadaného ConfigurationElementCollectionklíče odebrán .

(Zděděno od ConfigurationElementCollection)
BaseRemove(Object)

Odebere ConfigurationElement kolekci.

(Zděděno od ConfigurationElementCollection)
BaseRemoveAt(Int32)

Odebere zadané umístění indexu ConfigurationElement .

(Zděděno od ConfigurationElementCollection)
Clear()

Odebere všechny RuleSettings objekty z kolekce.

Contains(String)

Vrátí true , pokud kolekce obsahuje objekt se zadaným RuleSettings názvem.

CopyTo(ConfigurationElement[], Int32)

Zkopíruje obsah ConfigurationElementCollection pole.

(Zděděno od ConfigurationElementCollection)
CreateNewElement()

Při přepsání v odvozené třídě vytvoří novou ConfigurationElement.

(Zděděno od ConfigurationElementCollection)
CreateNewElement(String)

Vytvoří novou ConfigurationElement při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Načte XML z konfiguračního souboru.

(Zděděno od ConfigurationElement)
Equals(Object)

Porovná se ConfigurationElementCollection zadaným objektem.

(Zděděno od ConfigurationElementCollection)
GetElementKey(ConfigurationElement)

Získá klíč elementu pro zadaný konfigurační prvek při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
GetEnumerator()

IEnumerator Získá, který se používá k iteraci prostřednictvím ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
GetHashCode()

Získá jedinečnou hodnotu představující ConfigurationElementCollection instanci.

(Zděděno od ConfigurationElementCollection)
GetTransformedAssemblyString(String)

Vrátí transformovanou verzi zadaného názvu sestavení.

(Zděděno od ConfigurationElement)
GetTransformedTypeString(String)

Vrátí transformovanou verzi zadaného názvu typu.

(Zděděno od ConfigurationElement)
GetType()

Type Získá aktuální instanci.

(Zděděno od Object)
IndexOf(String)

Vyhledá index RuleSettings objektu v kolekci se zadaným názvem.

Init()

ConfigurationElement Nastaví objekt na počáteční stav.

(Zděděno od ConfigurationElement)
InitializeDefault()

Slouží k inicializaci výchozí sady hodnot objektu ConfigurationElement .

(Zděděno od ConfigurationElement)
Insert(Int32, RuleSettings)

Přidá zadaný RuleSettings objekt do zadaného bodu indexu v kolekci.

IsElementName(String)

Určuje, zda zadaný ConfigurationElement soubor existuje v souboru ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Určuje, zda je možné zadanou možnost ConfigurationElement odebrat ze ConfigurationElementCollectionsouboru .

(Zděděno od ConfigurationElementCollection)
IsModified()

Určuje, zda byla ConfigurationElementCollection změněna od posledního uložení nebo načtení při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
IsReadOnly()

Určuje, jestli ConfigurationElementCollection je objekt jen pro čtení.

(Zděděno od ConfigurationElementCollection)
ListErrors(IList)

Přidá chyby neplatné vlastnosti v tomto ConfigurationElement objektu a ve všech dílčích počtech do předaného seznamu.

(Zděděno od ConfigurationElement)
MemberwiseClone()

Vytvoří použádnou kopii aktuálního souboru Object.

(Zděděno od Object)
OnDeserializeUnrecognizedAttribute(String, String)

Získá hodnotu označující, zda je zjištěn neznámý atribut během deserializace.

(Zděděno od ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Způsobí, že konfigurační systém vyvolá výjimku.

(Zděděno od ConfigurationElementCollection)
OnRequiredPropertyNotFound(String)

Vyvolá výjimku, když se nenajde požadovaná vlastnost.

(Zděděno od ConfigurationElement)
PostDeserialize()

Volá se po deserializaci.

(Zděděno od ConfigurationElement)
PreSerialize(XmlWriter)

Volá se před serializací.

(Zděděno od ConfigurationElement)
Remove(String)

Odebere RuleSettings objekt z kolekce.

RemoveAt(Int32)

Odebere RuleSettings objekt v zadaném umístění indexu z kolekce.

Reset(ConfigurationElement)

Resetuje ConfigurationElementCollection stav do nemodifikovaného stavu při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
ResetModified()

Obnoví hodnotu IsModified() vlastnosti na false při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Zapíše konfigurační data do elementu XML v konfiguračním souboru při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Zapíše vnější značky tohoto konfiguračního prvku do konfiguračního souboru při implementaci v odvozené třídě.

(Zděděno od ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Nastaví vlastnost na zadanou hodnotu.

(Zděděno od ConfigurationElement)
SetReadOnly()

Nastaví vlastnost objektu IsReadOnly() ConfigurationElementCollection a pro všechny dílčí prvky.

(Zděděno od ConfigurationElementCollection)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Vrátí účinek sloučení informací o konfiguraci z různých úrovní hierarchie konfigurace.

(Zděděno od ConfigurationElementCollection)

Explicitní implementace rozhraní

ICollection.CopyTo(Array, Int32)

Zkopíruje pole ConfigurationElementCollection .

(Zděděno od ConfigurationElementCollection)

Metody rozšíření

Cast<TResult>(IEnumerable)

Přetypuje prvky zadaného IEnumerable typu.

OfType<TResult>(IEnumerable)

Filtruje prvky IEnumerable založené na zadaném typu.

AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede na IEnumerable IQueryable.

Platí pro

Viz také