RootProfilePropertySettingsCollection Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Dient als Oberster einer zweistufigen benannten Hierarchie von ProfilePropertySettingsCollection Auflistungen.
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
-
RootProfilePropertySettingsCollection
- Attribute
Beispiele
Das folgende Codebeispiel zeigt, wie der RootProfilePropertySettingsCollection Typ als PropertySettings Eigenschaft der ProfileSection Klasse verwendet wird. 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 Sammlung auf Stammebene ProfilePropertySettingsCollection als auch ein Container für eine ProfileGroupSettingsCollection Auflistung. Mit diesen Auflistungen können Sie benannte Gruppen mit weiteren ProfilePropertySettingsCollection Auflistungen 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 Im properties Unterabschnitt des profile Abschnitts der Konfigurationsdatei definierten Eigenschaften enthält.
Konstruktoren
| Name | Beschreibung |
|---|---|
| RootProfilePropertySettingsCollection() |
Initialisiert eine neue Instanz der RootProfilePropertySettingsCollection Klasse mithilfe von Standardeinstellungen. |
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) |
| AllKeys |
Gibt ein Array zurück, das die Namen aller Objekte enthält, die ProfileSection in der Auflistung enthalten sind. (Geerbt von ProfilePropertySettingsCollection) |
| AllowClear |
Ruft einen Wert ab, der angibt, ob das <clear-Element> als ProfilePropertySettings Objekt gültig ist. (Geerbt von ProfilePropertySettingsCollection) |
| 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) |
| GroupSettings |
Ruft eine ProfileGroupSettingsCollection enthaltende Auflistung von ProfileGroupSettings Objekten ab. |
| HasContext |
Ruft einen Wert ab, der angibt, ob die CurrentConfiguration Eigenschaft ist |
| 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] |
Ruft ab oder legt das ProfilePropertySettings Objekt an der angegebenen Indexposition fest. (Geerbt von ProfilePropertySettingsCollection) |
| Item[String] |
Dient zum Abrufen oder Festlegen des ProfilePropertySettings Objekts mit dem angegebenen Namen. (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 |
Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob das Element gesperrt ist. (Geerbt von ConfigurationElement) |
| Properties |
Ruft eine Auflistung von Konfigurationseigenschaften ab. (Geerbt von ProfilePropertySettingsCollection) |
| 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 Fehler ausgelöst werden soll, wenn versucht wird, ein dupliziertes Objekt zu erstellen. (Geerbt von ProfilePropertySettingsCollection) |
Methoden
| Name | Beschreibung |
|---|---|
| Add(ProfilePropertySettings) |
Fügt der Auflistung ein ProfilePropertySettings Objekt hinzu. (Geerbt von ProfilePropertySettingsCollection) |
| 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 ProfilePropertySettings Objekte aus der Auflistung. (Geerbt von ProfilePropertySettingsCollection) |
| 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 ProfilePropertySettingsCollection) |
| 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 aktuelle RootProfilePropertySettingsCollection Objekt mit einem anderen A-Objekt RootProfilePropertySettingsCollection . |
| 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 ein IEnumerator , das zum Durchlaufen der ConfigurationElementCollection. (Geerbt von ConfigurationElementCollection) |
| GetHashCode() |
Generiert einen Hashcode für die Auflistung. |
| GetKey(Int32) |
Ruft den Namen des ProfilePropertySettings an der angegebenen Indexposition angegebenen Speicherorts 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 die Type der aktuellen Instanz ab. (Geerbt von Object) |
| IndexOf(ProfilePropertySettings) |
Gibt den Index des angegebenen ProfilePropertySettings Objekts zurück. (Geerbt von ProfilePropertySettingsCollection) |
| 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) |
| 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) |
Behandelt das Lesen nicht erkannter Konfigurationselemente aus einer Konfigurationsdatei und bewirkt, dass das Konfigurationssystem eine Ausnahme auslöst, 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 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 |
| 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) |
| Set(ProfilePropertySettings) |
Fügt das angegebene ProfilePropertySettings Objekt der Auflistung 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 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. |