ProfileSettingsCollection Klasse

Definition

Enthält eine Auflistung von ProfileSettings Objekten. Diese Klasse kann nicht vererbt werden.

public ref class ProfileSettingsCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfileSettings))]
public sealed class ProfileSettingsCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfileSettings))>]
type ProfileSettingsCollection = class
    inherit ConfigurationElementCollection
Public NotInheritable Class ProfileSettingsCollection
Inherits ConfigurationElementCollection
Vererbung
Attribute

Beispiele

Das folgende Codebeispiel zeigt, wie der ProfileSettingsCollection Typ verwendet wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die HealthMonitoringSection Klasse bereitgestellt wird.


// Add a ProfileSettings object to the Profiles collection property.
ProfileSettings profileSetting = new ProfileSettings("Default");
profileSetting.Name = "Custom";
profileSetting.MaxLimit = Int32.MaxValue;
profileSetting.MinInstances = 1;
profileSetting.MinInterval = TimeSpan.Parse("00:01:00");
profileSetting.Custom = "MyEvaluators.MyCustomeEvaluator, MyCustom.dll";
healthMonitoringSection.Profiles.Add(profileSetting);

// Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Default"));

// Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Critical", 
    1, 1024, new TimeSpan(0, 0, 00)));

// Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Targeted", 
    1, Int32.MaxValue, new TimeSpan(0, 0, 10), 
    "MyEvaluators.MyTargetedEvaluator, MyCustom.dll"));

// Insert an ProfileSettings object into the Profiles collection property.
healthMonitoringSection.Profiles.Insert(1, new ProfileSettings("Default2"));

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

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

// See if the ProfileSettings collection property contains the event 'Default'.
Console.WriteLine("Profiles contains 'Default': {0}.",
    healthMonitoringSection.Profiles.Contains("Default"));

// Get the index of the 'Default' ProfileSettings in the Profiles collection property.
Console.WriteLine("Profiles index for 'Default': {0}.",
    healthMonitoringSection.Profiles.IndexOf("Default"));

// Get a named ProfileSettings
profileSetting = healthMonitoringSection.Profiles["Default"];

// Remove a ProfileSettings object from the Profiles collection property.
healthMonitoringSection.Profiles.Remove("Default");

// Remove a ProfileSettings object from the Profiles collection property.
healthMonitoringSection.Profiles.RemoveAt(0);

// Clear all ProfileSettings object from the Profiles collection property.
healthMonitoringSection.Profiles.Clear();

' Add a ProfileSettings object to the Profiles collection property.
            Dim profileSetting As ProfileSettings = New ProfileSettings("Default")
profileSetting.Name = "Custom"
profileSetting.MaxLimit = Int32.MaxValue
profileSetting.MinInstances = 1
profileSetting.MinInterval = TimeSpan.Parse("00:01:00")
profileSetting.Custom = "MyEvaluators.MyCustomeEvaluator, MyCustom.dll"
healthMonitoringSection.Profiles.Add(profileSetting)

' Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Default"))

' Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Critical",  _
    1, 1024, new TimeSpan(0, 0, 00)))

' Add a ProfileSettings object to the Profiles collection property.
healthMonitoringSection.Profiles.Add(new ProfileSettings("Targeted", _
    1, Int32.MaxValue, new TimeSpan(0, 0, 10), _
    "MyEvaluators.MyTargetedEvaluator, MyCustom.dll"))

' Insert an ProfileSettings object into the Profiles collection property.
healthMonitoringSection.Profiles.Insert(1, new ProfileSettings("Default2"))

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

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

' See if the ProfileSettings collection property contains the event 'Default'.
Console.WriteLine("Profiles contains 'Default': {0}.", _
    healthMonitoringSection.Profiles.Contains("Default"))

' Get the index of the 'Default' ProfileSettings in the Profiles collection property.
Console.WriteLine("Profiles index for 'Default': {0}.", _
    healthMonitoringSection.Profiles.IndexOf("Default"))

' Get a named ProfileSettings
profileSetting = healthMonitoringSection.Profiles("Default")

' Remove a ProfileSettings object from the Profiles collection property.
healthMonitoringSection.Profiles.Remove("Default")

' Remove a ProfileSettings object from the Profiles collection property.
healthMonitoringSection.Profiles.RemoveAt(0)

' Clear all ProfileSettings object from the Profiles collection property.
healthMonitoringSection.Profiles.Clear()

Hinweise

ProfileSettings Objekte werden verwendet, um Ereignisprofile zu definieren.

Konstruktoren

Name Beschreibung
ProfileSettingsCollection()

Initialisiert eine neue Instanz der ProfileSettingsCollection-Klasse.

Eigenschaften

Name Beschreibung
AddElementName

Dient zum Abrufen oder Festlegen des Namens des ConfigurationElement Add-Vorgangs, der dem Add-Vorgang in einer ConfigurationElementCollection abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
ClearElementName

Dient zum Abrufen oder Festlegen des Namens für den ConfigurationElement zuordnenden clear-Vorgang in der ConfigurationElementCollection Beim Außerkraftsetzung in einer abgeleiteten Klasse.

(Geerbt von ConfigurationElementCollection)
CollectionType

Ruft den Typ der .ConfigurationElementCollection

(Geerbt von ConfigurationElementCollection)
Count

Ruft die Anzahl der Elemente in der Auflistung ab.

(Geerbt von ConfigurationElementCollection)
CurrentConfiguration

Ruft einen Verweis auf die Instanz der obersten Ebene Configuration ab, die die Konfigurationshierarchie darstellt, zu der die aktuelle ConfigurationElement Instanz gehört.

(Geerbt von ConfigurationElement)
ElementInformation

Ruft ein ElementInformation Objekt ab, das die nicht anpassbaren Informationen und Funktionen des ConfigurationElement Objekts enthält.

(Geerbt von ConfigurationElement)
ElementName

Ruft den Namen ab, der verwendet wird, um diese Auflistung von Elementen in der Konfigurationsdatei zu identifizieren, wenn diese in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
ElementProperty

Ruft das ConfigurationElementProperty Objekt ab, das das ConfigurationElement Objekt selbst darstellt.

(Geerbt von ConfigurationElement)
EmitClear

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob die Auflistung gelöscht wurde.

(Geerbt von ConfigurationElementCollection)
EvaluationContext

Ruft das ContextInformation-Objekt für das ConfigurationElement-Objekt ab.

(Geerbt von ConfigurationElement)
HasContext

Ruft einen Wert ab, der angibt, ob die CurrentConfiguration Eigenschaft ist null.

(Geerbt von ConfigurationElement)
IsSynchronized

Ruft einen Wert ab, der angibt, ob der Zugriff auf die Auflistung synchronisiert wird.

(Geerbt von ConfigurationElementCollection)
Item[ConfigurationProperty]

Dient zum Abrufen oder Festlegen einer Eigenschaft oder eines Attributs dieses Konfigurationselements.

(Geerbt von ConfigurationElement)
Item[Int32]

Dient zum Abrufen oder Festlegen des ProfileSettings Objekts am angegebenen numerischen Index in der Auflistung.

Item[String]

Ruft das ProfileSettings Objekt basierend auf dem angegebenen Schlüssel in der Auflistung ab.

LockAllAttributesExcept

Ruft die Auflistung gesperrter Attribute ab.

(Geerbt von ConfigurationElement)
LockAllElementsExcept

Ruft die Auflistung gesperrter Elemente ab.

(Geerbt von ConfigurationElement)
LockAttributes

Ruft die Auflistung gesperrter Attribute ab.

(Geerbt von ConfigurationElement)
LockElements

Ruft die Auflistung gesperrter Elemente ab.

(Geerbt von ConfigurationElement)
LockItem

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob das Element gesperrt ist.

(Geerbt von ConfigurationElement)
Properties

Ruft die Auflistung von Eigenschaften ab.

(Geerbt von ConfigurationElement)
RemoveElementName

Dient zum Abrufen oder Festlegen des Namens des ConfigurationElement zuzuordnenden Vorgangs zum Entfernen im ConfigurationElementCollection Zeitpunkt der Außerkraftsetzung in einer abgeleiteten Klasse.

(Geerbt von ConfigurationElementCollection)
SyncRoot

Ruft ein Objekt ab, das zum Synchronisieren des Zugriffs auf die ConfigurationElementCollection.

(Geerbt von ConfigurationElementCollection)
ThrowOnDuplicate

Ruft einen Wert ab, der angibt, ob ein Versuch, einem Duplikat ConfigurationElement hinzuzufügen, ConfigurationElementCollection eine Ausnahme ausgelöst wird.

(Geerbt von ConfigurationElementCollection)

Methoden

Name Beschreibung
Add(ProfileSettings)

Fügt der Auflistung ein ProfileSettings Objekt hinzu.

BaseAdd(ConfigurationElement, Boolean)

Fügt der Konfigurationselementauflistung ein Konfigurationselement hinzu.

(Geerbt von ConfigurationElementCollection)
BaseAdd(ConfigurationElement)

Fügt dem ConfigurationElementCollection.-Element ein Konfigurationselement hinzu.

(Geerbt von ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Fügt der Konfigurationselementauflistung ein Konfigurationselement hinzu.

(Geerbt von ConfigurationElementCollection)
BaseClear()

Entfernt alle Konfigurationselementobjekte aus der Auflistung.

(Geerbt von ConfigurationElementCollection)
BaseGet(Int32)

Ruft das Konfigurationselement am angegebenen Indexspeicherort ab.

(Geerbt von ConfigurationElementCollection)
BaseGet(Object)

Gibt das Konfigurationselement mit dem angegebenen Schlüssel zurück.

(Geerbt von ConfigurationElementCollection)
BaseGetAllKeys()

Gibt ein Array der Schlüssel für alle Konfigurationselemente zurück, die in der ConfigurationElementCollection.

(Geerbt von ConfigurationElementCollection)
BaseGetKey(Int32)

Ruft den Schlüssel für den ConfigurationElement angegebenen Indexspeicherort ab.

(Geerbt von ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Gibt den Index des angegebenen .ConfigurationElement

(Geerbt von ConfigurationElementCollection)
BaseIsRemoved(Object)

Gibt an, ob der ConfigurationElement mit dem angegebenen Schlüssel aus dem ConfigurationElementCollection.

(Geerbt von ConfigurationElementCollection)
BaseRemove(Object)

Entfernt eine ConfigurationElement Aus der Auflistung.

(Geerbt von ConfigurationElementCollection)
BaseRemoveAt(Int32)

Entfernt den ConfigurationElement Angegebenen Indexspeicherort.

(Geerbt von ConfigurationElementCollection)
Clear()

Entfernt alle ProfileSettings Objekte aus der Auflistung.

Contains(String)

Gibt an, ob die Auflistung ein ProfileSettings Objekt mit dem angegebenen Namen enthält.

CopyTo(ConfigurationElement[], Int32)

Kopiert den Inhalt des ConfigurationElementCollection Elements in ein Array.

(Geerbt von ConfigurationElementCollection)
CreateNewElement()

Wenn sie in einer abgeleiteten Klasse überschrieben wird, wird ein neues ConfigurationElementerstellt.

(Geerbt von ConfigurationElementCollection)
CreateNewElement(String)

Erstellt eine neue ConfigurationElement , wenn sie in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Liest XML aus der Konfigurationsdatei.

(Geerbt von ConfigurationElement)
Equals(Object)

Vergleicht das ConfigurationElementCollection angegebene Objekt.

(Geerbt von ConfigurationElementCollection)
GetElementKey(ConfigurationElement)

Ruft den Elementschlüssel für ein angegebenes Konfigurationselement ab, wenn es in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
GetEnumerator()

Ruft ein IEnumerator , das zum Durchlaufen der ConfigurationElementCollection.

(Geerbt von ConfigurationElementCollection)
GetHashCode()

Ruft einen eindeutigen Wert ab, der die ConfigurationElementCollection Instanz darstellt.

(Geerbt von ConfigurationElementCollection)
GetTransformedAssemblyString(String)

Gibt die transformierte Version des angegebenen Assemblynamens zurück.

(Geerbt von ConfigurationElement)
GetTransformedTypeString(String)

Gibt die transformierte Version des angegebenen Typnamens zurück.

(Geerbt von ConfigurationElement)
GetType()

Ruft die Type der aktuellen Instanz ab.

(Geerbt von Object)
IndexOf(String)

Gibt den Index des angegebenen ProfileSettings Objekts zurück.

Init()

Legt das ConfigurationElement Objekt auf seinen Anfangszustand fest.

(Geerbt von ConfigurationElement)
InitializeDefault()

Wird verwendet, um einen Standardsatz von Werten für das ConfigurationElement Objekt zu initialisieren.

(Geerbt von ConfigurationElement)
Insert(Int32, ProfileSettings)

Fügt das angegebene ProfileSettings Objekt am angegebenen Index in der Auflistung ein.

IsElementName(String)

Gibt an, ob die angegebene ConfigurationElement in der ConfigurationElementCollection.

(Geerbt von ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Gibt an, ob der angegebene ConfigurationElement Wert aus dem ConfigurationElementCollection.

(Geerbt von ConfigurationElementCollection)
IsModified()

Gibt an, ob dies ConfigurationElementCollection seit dem letzten Speichern oder Laden geändert wurde, wenn sie in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
IsReadOnly()

Gibt an, ob das ConfigurationElementCollection Objekt schreibgeschützt ist.

(Geerbt von ConfigurationElementCollection)
ListErrors(IList)

Fügt der übergebenen Liste die Fehler der ungültigen Eigenschaft in diesem ConfigurationElement Objekt und in allen Unterelementen hinzu.

(Geerbt von ConfigurationElement)
MemberwiseClone()

Erstellt eine flache Kopie der aktuellen Object.

(Geerbt von Object)
OnDeserializeUnrecognizedAttribute(String, String)

Ruft einen Wert ab, der angibt, ob während der Deserialisierung ein unbekanntes Attribut gefunden wird.

(Geerbt von ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Bewirkt, dass das Konfigurationssystem eine Ausnahme auslöst.

(Geerbt von ConfigurationElementCollection)
OnRequiredPropertyNotFound(String)

Löst eine Ausnahme aus, wenn eine erforderliche Eigenschaft nicht gefunden wird.

(Geerbt von ConfigurationElement)
PostDeserialize()

Wird nach der Deserialisierung aufgerufen.

(Geerbt von ConfigurationElement)
PreSerialize(XmlWriter)

Wird vor der Serialisierung aufgerufen.

(Geerbt von ConfigurationElement)
Remove(String)

Entfernt ein BufferModeSettings Objekt aus der Auflistung.

RemoveAt(Int32)

Entfernt ein ProfileSettings Objekt an der angegebenen Indexposition aus der Auflistung.

Reset(ConfigurationElement)

Setzt den ConfigurationElementCollection zustandslos zurück, wenn er in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
ResetModified()

Setzt den Wert der IsModified() Eigenschaft zurück, wenn false sie in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Schreibt die Konfigurationsdaten in ein XML-Element in der Konfigurationsdatei, wenn dies in einer abgeleiteten Klasse überschrieben wird.

(Geerbt von ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Schreibt die äußeren Tags dieses Konfigurationselements in die Konfigurationsdatei, wenn sie in einer abgeleiteten Klasse implementiert wird.

(Geerbt von ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Legt eine Eigenschaft auf den angegebenen Wert fest.

(Geerbt von ConfigurationElement)
SetReadOnly()

Legt die IsReadOnly() Eigenschaft für das ConfigurationElementCollection Objekt und für alle Unterelemente fest.

(Geerbt von ConfigurationElementCollection)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Kehrt die Auswirkung des Zusammenführens von Konfigurationsinformationen aus verschiedenen Ebenen der Konfigurationshierarchie auf.

(Geerbt von ConfigurationElementCollection)

Explizite Schnittstellenimplementierungen

Name Beschreibung
ICollection.CopyTo(Array, Int32)

Kopiert das ConfigurationElementCollection Array in ein Array.

(Geerbt von ConfigurationElementCollection)

Erweiterungsmethoden

Name Beschreibung
AsParallel(IEnumerable)

Aktiviert die Parallelisierung einer Abfrage.

AsQueryable(IEnumerable)

Wandelt eine IEnumerable in eine IQueryableum.

Cast<TResult>(IEnumerable)

Wandelt die Elemente eines IEnumerable in den angegebenen Typ um.

OfType<TResult>(IEnumerable)

Filtert die Elemente einer IEnumerable basierend auf einem angegebenen Typ.

Gilt für:

Weitere Informationen