RootProfilePropertySettingsCollection Klasse

Definition

Stellt die oberste Ebene einer aus zwei Ebenen bestehenden benannten Hierarchie von ProfilePropertySettingsCollection-Auflistungen dar.

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

Beispiele

Das folgende Codebeispiel zeigt, wie Sie den RootProfilePropertySettingsCollection Typ als PropertySettings Eigenschaft der ProfileSection -Klasse verwenden. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die ProfileSection-Klasse bereitgestellt wird.


// Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:");
int rootPPSCtr = 0;
foreach (ProfilePropertySettings rootPPS in profileSection.PropertySettings)
{
    Console.WriteLine("  {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr,
        rootPPS.Name);
}

// Get and modify a root ProfilePropertySettings object.
Console.WriteLine(
    "Display and modify 'LastReadDate' ProfilePropertySettings:");
ProfilePropertySettings profilePropertySettings =
    profileSection.PropertySettings["LastReadDate"];

// Get the current ReadOnly property value.
Console.WriteLine(
    "Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly);

// Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true;

// Get the current AllowAnonymous property value.
Console.WriteLine(
    "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous);

// Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true;

// Get the current SerializeAs property value.
Console.WriteLine(
    "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs);

// Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary;

// Get the current Type property value.
Console.WriteLine(
    "Current Type value: '{0}'", profilePropertySettings.Type);

// Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime";

// Get the current DefaultValue property value.
Console.WriteLine(
    "Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue);

// Set the DefaultValue property to "March 16, 2004".
profilePropertySettings.DefaultValue = "March 16, 2004";

// Get the current ProviderName property value.
Console.WriteLine(
    "Current ProviderName value: '{0}'", profilePropertySettings.Provider);

// Set the ProviderName property to "AspNetSqlRoleProvider".
profilePropertySettings.Provider = "AspNetSqlRoleProvider";

// Get the current Name property value.
Console.WriteLine(
    "Current Name value: '{0}'", profilePropertySettings.Name);

// Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate";

// Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:");
int PGSCtr = 0;
foreach (ProfileGroupSettings propGroups in profileSection.PropertySettings.GroupSettings)
{
    Console.WriteLine("  {0}: ProfileGroupSetting '{1}'", ++PGSCtr,
        propGroups.Name);
    int PPSCtr = 0;
    foreach (ProfilePropertySettings props in propGroups.PropertySettings)
    {
        Console.WriteLine("    {0}: ProfilePropertySetting '{1}'", ++PPSCtr,
            props.Name);
    }
}

// Add a new group.
ProfileGroupSettings newPropGroup = new ProfileGroupSettings("Forum");
profileSection.PropertySettings.GroupSettings.Add(newPropGroup);

// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);

// Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage");
newPropGroup.PropertySettings.RemoveAt(0);

// Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear();


' Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:")
Dim rootPPSCtr As Integer = 0
For Each rootPPS As ProfilePropertySettings In profileSection.PropertySettings
    Console.WriteLine("  {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr, _
        rootPPS.Name)
Next

' Get and modify a root ProfilePropertySettings object.
Console.WriteLine( _
    "Display and modify 'LastReadDate' ProfilePropertySettings:")
Dim profilePropertySettings As ProfilePropertySettings = _
    profileSection.PropertySettings("LastReadDate")

' Get the current ReadOnly property value.
Console.WriteLine( _
    "Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly)

' Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true

' Get the current AllowAnonymous property value.
Console.WriteLine( _
    "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous)

' Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true

' Get the current SerializeAs property value.
Console.WriteLine( _
    "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs)

' Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary

' Get the current Type property value.
Console.WriteLine( _
    "Current Type value: '{0}'", profilePropertySettings.Type)

' Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime"

' Get the current DefaultValue property value.
Console.WriteLine( _
    "Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue)

' Set the DefaultValue property to "March 16, 2004".
profilePropertySettings.DefaultValue = "March 16, 2004"

' Get the current ProviderName property value.
            Console.WriteLine( _
                "Current ProviderName value: '{0}'", profilePropertySettings.Provider)

' Set the ProviderName property to "AspNetSqlRoleProvider".
            profilePropertySettings.Provider = "AspNetSqlRoleProvider"

' Get the current Name property value.
Console.WriteLine( _
    "Current Name value: '{0}'", profilePropertySettings.Name)

' Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate"

' Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:")
Dim PGSCtr As Integer = 0
For Each propGroups As ProfileGroupSettings In profileSection.PropertySettings.GroupSettings
                    Console.WriteLine("  {0}: ProfileGroupSettings '{1}'", ++PGSCtr, _
        propGroups.Name)
    Dim PPSCtr As Integer = 0
    For Each props As ProfilePropertySettings In propGroups.PropertySettings
        Console.WriteLine("    {0}: ProfilePropertySetting '{1}'", ++PPSCtr, _
            props.Name)
    Next
Next

' Add a new group.
Dim newPropGroup As ProfileGroupSettings = new ProfileGroupSettings("Forum")
profileSection.PropertySettings.GroupSettings.Add(newPropGroup)

' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)

' Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage")
newPropGroup.PropertySettings.RemoveAt(0)

' Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear()

Hinweise

Die RootProfilePropertySettingsCollection -Klasse ist sowohl eine Auflistung auf Stammebene ProfilePropertySettingsCollection als auch ein Container für eine ProfileGroupSettingsCollection Auflistung. Mit diesen Sammlungen können Sie benannte Gruppen von weiteren ProfilePropertySettingsCollection Sammlungen erstellen, die jeweils einzelne benannte ProfilePropertySettings Objekte enthalten. Weitere Informationen zu den Profilfeatures, die ASP.NET 2.0 hinzugefügt wurden, finden Sie unter ASP.NET Profileigenschaften.

Die PropertySettings -Eigenschaft ist ein RootProfilePropertySettingsCollection -Objekt, das alle Eigenschaften enthält, die properties im Unterabschnitt des Abschnitts der profile Konfigurationsdatei definiert sind.

Konstruktoren

RootProfilePropertySettingsCollection()

Initialisiert eine neue Instanz der RootProfilePropertySettingsCollection-Klasse mit Standardeinstellungen.

Eigenschaften

AddElementName

Ruft den Namen des ConfigurationElement ab, das beim Überschreiben in einer abgeleiteten Klasse dem Hinzufügevorgang in der ConfigurationElementCollection zugeordnet werden soll, oder legt diesen fest.

(Geerbt von ConfigurationElementCollection)
AllKeys

Gibt ein Array mit den Namen aller in der Auflistung enthaltenen ProfileSection-Objekte zurück.

(Geerbt von ProfilePropertySettingsCollection)
AllowClear

Ruft einen Wert ab, der angibt, ob das <clear>-Element als ProfilePropertySettings-Objekt gültig ist.

(Geerbt von ProfilePropertySettingsCollection)
ClearElementName

Ruft den Namen für das ConfigurationElement ab, das beim Überschreiben in einer abgeleiteten Klasse dem Löschvorgang in der ConfigurationElementCollection zugeordnet werden soll, oder legt diesen fest.

(Geerbt von ConfigurationElementCollection)
CollectionType

Ruft den Typ des ConfigurationElementCollection ab.

(Geerbt von ConfigurationElementCollection)
Count

Ruft die Anzahl der Elemente in der Auflistung ab.

(Geerbt von ConfigurationElementCollection)
CurrentConfiguration

Ruft einen Verweis auf die Configuration-Instanz der obersten Ebene 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 beim Überschreiben in einer abgeleiteten Klasse für die Identifikation dieser Auflistung mit Elementen in der Konfigurationsdatei verwendet wird.

(Geerbt von ConfigurationElementCollection)
ElementProperty

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

(Geerbt von ConfigurationElement)
EmitClear

Ruft einen Wert ab, der angibt, ob die Auflistung gelöscht wurde, oder legt diesen fest.

(Geerbt von ConfigurationElementCollection)
EvaluationContext

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

(Geerbt von ConfigurationElement)
GroupSettings

Ruft eine ProfileGroupSettingsCollection ab, die eine Auflistung von ProfileGroupSettings-Objekten enthält.

HasContext

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

(Geerbt von ConfigurationElement)
IsSynchronized

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

(Geerbt von ConfigurationElementCollection)
Item[ConfigurationProperty]

Ruft eine Eigenschaft oder ein Attribut dieses Konfigurationselements ab oder legt diese bzw. dieses fest.

(Geerbt von ConfigurationElement)
Item[Int32]

Ruft das ProfilePropertySettings-Objekt an der angegebenen Indexposition ab oder legt dieses fest.

(Geerbt von ProfilePropertySettingsCollection)
Item[String]

Ruft das ProfilePropertySettings-Objekt mit dem angegebenen Namen ab oder legt dieses fest.

(Geerbt von ProfilePropertySettingsCollection)
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

Ruft einen Wert ab, der angibt, ob das Element gesperrt ist, oder legt diesen fest.

(Geerbt von ConfigurationElement)
Properties

Ruft eine Auflistung von Konfigurationseigenschaften ab.

(Geerbt von ProfilePropertySettingsCollection)
RemoveElementName

Ruft den Namen des ConfigurationElement ab, das beim Überschreiben in einer abgeleiteten Klasse dem Entfernungsvorgang in der ConfigurationElementCollection zugeordnet werden soll, oder legt diesen fest.

(Geerbt von ConfigurationElementCollection)
SyncRoot

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

(Geerbt von ConfigurationElementCollection)
ThrowOnDuplicate

Ruft einen Wert ab, der angibt, ob bei dem Versuch, ein Objektduplikat zu erstellen, ein Fehler ausgelöst werden soll.

(Geerbt von ProfilePropertySettingsCollection)

Methoden

Add(ProfilePropertySettings)

Fügt der Auflistung ein ProfilePropertySettings-Objekt hinzu.

(Geerbt von ProfilePropertySettingsCollection)
BaseAdd(ConfigurationElement)

Fügt der ConfigurationElementCollection ein Konfigurationselement hinzu.

(Geerbt von ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Fügt der Konfigurationselementauflistung 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 Index 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 in der ConfigurationElementCollection zurück.

(Geerbt von ConfigurationElementCollection)
BaseGetKey(Int32)

Ruft den Schlüssel für das ConfigurationElement an der angegebenen Indexposition ab.

(Geerbt von ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Gibt den Index der angegebenen ConfigurationElement an.

(Geerbt von ConfigurationElementCollection)
BaseIsRemoved(Object)

Gibt an, ob das ConfigurationElement mit dem angegebenen Schlüssel aus der ConfigurationElementCollection entfernt worden ist.

(Geerbt von ConfigurationElementCollection)
BaseRemove(Object)

Entfernt ein ConfigurationElement aus der Auflistung.

(Geerbt von ConfigurationElementCollection)
BaseRemoveAt(Int32)

Entfernt das ConfigurationElement an der angegebenen Indexposition.

(Geerbt von ConfigurationElementCollection)
Clear()

Entfernt alle ProfilePropertySettings-Objekte aus der Auflistung.

(Geerbt von ProfilePropertySettingsCollection)
CopyTo(ConfigurationElement[], Int32)

Kopiert den Inhalt der ConfigurationElementCollection in ein Array.

(Geerbt von ConfigurationElementCollection)
CreateNewElement()

Erstellt beim Überschreiben in einer abgeleiteten Klasse einen neuen ConfigurationElement.

(Geerbt von ProfilePropertySettingsCollection)
CreateNewElement(String)

Erstellt ein neues ConfigurationElement, wenn es in einer abgeleiteten Klasse überschrieben wurde.

(Geerbt von ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Liest XML aus der Konfigurationsdatei.

(Geerbt von ConfigurationElement)
Equals(Object)

Vergleicht das aktuelle RootProfilePropertySettingsCollection-Objekt mit einem anderen RootProfilePropertySettingsCollection-Objekt.

Get(Int32)

Gibt das ProfileSection-Objekt am angegebenen Index zurück.

(Geerbt von ProfilePropertySettingsCollection)
Get(String)

Gibt das ProfileSection-Objekt mit dem angegebenen Namen zurück.

(Geerbt von ProfilePropertySettingsCollection)
GetElementKey(ConfigurationElement)

Ruft den Schlüssel für das angegebene Konfigurationselement ab.

(Geerbt von ProfilePropertySettingsCollection)
GetEnumerator()

Ruft einen IEnumerator ab, der zum Durchlaufen von ConfigurationElementCollection verwendet wird.

(Geerbt von ConfigurationElementCollection)
GetHashCode()

Generiert einen Hashcode für die Auflistung.

GetKey(Int32)

Ruft den Namen der ProfilePropertySettings an der angegebenen Indexposition ab.

(Geerbt von ProfilePropertySettingsCollection)
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 den Type der aktuellen Instanz ab.

(Geerbt von Object)
IndexOf(ProfilePropertySettings)

Gibt den Index des angegebenen ProfilePropertySettings-Objekts zurück.

(Geerbt von ProfilePropertySettingsCollection)
Init()

Legt für das ConfigurationElement-Objekt den Ausgangszustand fest.

(Geerbt von ConfigurationElement)
InitializeDefault()

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

(Geerbt von ConfigurationElement)
IsElementName(String)

Gibt an, ob das angegebene ConfigurationElement in der ConfigurationElementCollection vorhanden ist.

(Geerbt von ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Gibt an, ob das angegebene ConfigurationElement aus der ConfigurationElementCollection entfernt werden kann.

(Geerbt von ConfigurationElementCollection)
IsModified()

Gibt an, ob diese ConfigurationElementCollection geändert wurde, seit sie zuletzt gespeichert oder geladen wurde, wenn sie in einer abgeleiteten Klasse überschrieben wurde.

(Geerbt von ConfigurationElementCollection)
IsReadOnly()

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

(Geerbt von ConfigurationElementCollection)
ListErrors(IList)

Fügt die Fehler über ungültige Eigenschaften in diesem ConfigurationElement-Objekt und in allen Unterelementen der übergebenen Liste hinzu.

(Geerbt von ConfigurationElement)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.

(Geerbt von Object)
OnDeserializeUnrecognizedAttribute(String, String)

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

(Geerbt von ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Behandelt das Lesen nicht erkannter Konfigurationselemente aus einer Konfigurationsdatei und verursacht das Auslösen einer Ausnahme durch das Konfigurationssystem, wenn das Element nicht behandelt werden kann.

(Geerbt von ProfilePropertySettingsCollection)
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 ProfilePropertySettings-Objekt aus der Auflistung.

(Geerbt von ProfilePropertySettingsCollection)
RemoveAt(Int32)

Entfernt ein ProfilePropertySettings-Objekt an der angegebenen Indexposition aus der Auflistung.

(Geerbt von ProfilePropertySettingsCollection)
Reset(ConfigurationElement)

Setzt die ConfigurationElementCollection auf ihren unveränderten Zustand zurück, wenn sie in einer abgeleiteten Klasse überschrieben wurde.

(Geerbt von ConfigurationElementCollection)
ResetModified()

Setzt den Wert der IsModified()-Eigenschaft auf false zurück, wenn er in einer abgeleiteten Klasse überschrieben wurde.

(Geerbt von ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

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

(Geerbt von ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Schreibt bei Implementierung in einer abgeleiteten Klasse die äußeren Tags dieses Konfigurationselements in die Konfigurationsdatei.

(Geerbt von ConfigurationElement)
Set(ProfilePropertySettings)

Fügt der Auflistung das angegebene ProfilePropertySettings-Objekt hinzu.

(Geerbt von ProfilePropertySettingsCollection)
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 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 Auswirkungen der Zusammenführung von Konfigurationsinformationen aus verschiedenen Ebenen der Konfigurationshierarchie um.

(Geerbt von ConfigurationElementCollection)

Explizite Schnittstellenimplementierungen

ICollection.CopyTo(Array, Int32)

Kopiert das ConfigurationElementCollection in ein Array.

(Geerbt von ConfigurationElementCollection)

Erweiterungsmethoden

Cast<TResult>(IEnumerable)

Wandelt die Elemente eines IEnumerable in den angegebenen Typ um

OfType<TResult>(IEnumerable)

Filtert die Elemente eines IEnumerable anhand eines angegebenen Typs

AsParallel(IEnumerable)

Ermöglicht die Parallelisierung einer Abfrage.

AsQueryable(IEnumerable)

Konvertiert einen IEnumerable in einen IQueryable.

Gilt für:

Weitere Informationen