RootProfilePropertySettingsCollection Clase
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Actúa como la parte superior de una jerarquía con nombre de dos niveles de ProfilePropertySettingsCollection colecciones.
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
- Herencia
-
RootProfilePropertySettingsCollection
- Atributos
Ejemplos
En el ejemplo de código siguiente se muestra cómo usar el RootProfilePropertySettingsCollection tipo como propiedad PropertySettings de la ProfileSection clase . Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la ProfileSection clase .
// 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()
Comentarios
La RootProfilePropertySettingsCollection clase es una colección de nivel ProfilePropertySettingsCollection raíz y un contenedor para una ProfileGroupSettingsCollection colección. Estas colecciones permiten crear grupos con nombre de más ProfilePropertySettingsCollection colecciones, cada una que contiene objetos con nombre ProfilePropertySettings individuales. Para obtener más información sobre las características de perfil agregadas a ASP.NET 2.0, consulte propiedades de perfil de ASP.NET.
La PropertySettings propiedad es un RootProfilePropertySettingsCollection objeto que contiene todas las propiedades definidas en la properties subsección de la profile sección del archivo de configuración.
Constructores
| Nombre | Description |
|---|---|
| RootProfilePropertySettingsCollection() |
Inicializa una nueva instancia de la RootProfilePropertySettingsCollection clase con la configuración predeterminada. |
Propiedades
| Nombre | Description |
|---|---|
| AddElementName |
Obtiene o establece el nombre del ConfigurationElement objeto que se va a asociar a la operación de adición en cuando ConfigurationElementCollection se invalida en una clase derivada. (Heredado de ConfigurationElementCollection) |
| AllKeys |
Devuelve una matriz que contiene los nombres de todos los ProfileSection objetos contenidos en la colección. (Heredado de ProfilePropertySettingsCollection) |
| AllowClear |
Obtiene un valor que indica si el <elemento clear> es válido como un ProfilePropertySettings objeto . (Heredado de ProfilePropertySettingsCollection) |
| ClearElementName |
Obtiene o establece el nombre del objeto que ConfigurationElement se va a asociar a la operación clear en cuando ConfigurationElementCollection se invalida en una clase derivada. (Heredado de ConfigurationElementCollection) |
| CollectionType |
Obtiene el tipo de ConfigurationElementCollection. (Heredado de ConfigurationElementCollection) |
| Count |
Obtiene el número de elementos de la colección. (Heredado de ConfigurationElementCollection) |
| CurrentConfiguration |
Obtiene una referencia a la instancia de nivel Configuration superior que representa la jerarquía de configuración a la que pertenece la instancia actual ConfigurationElement . (Heredado de ConfigurationElement) |
| ElementInformation |
Obtiene un ElementInformation objeto que contiene la información y la funcionalidad no personalizables del ConfigurationElement objeto . (Heredado de ConfigurationElement) |
| ElementName |
Obtiene el nombre usado para identificar esta colección de elementos en el archivo de configuración cuando se reemplaza en una clase derivada. (Heredado de ConfigurationElementCollection) |
| ElementProperty |
Obtiene el ConfigurationElementProperty objeto que representa el ConfigurationElement propio objeto. (Heredado de ConfigurationElement) |
| EmitClear |
Obtiene o establece un valor que especifica si se ha borrado la colección. (Heredado de ConfigurationElementCollection) |
| EvaluationContext |
Obtiene el objeto ContextInformation para el objeto ConfigurationElement. (Heredado de ConfigurationElement) |
| GroupSettings |
Obtiene un ProfileGroupSettingsCollection objeto que contiene una colección de ProfileGroupSettings objetos . |
| HasContext |
Obtiene un valor que indica si la CurrentConfiguration propiedad es |
| IsSynchronized |
Obtiene un valor que indica si se sincroniza el acceso a la colección. (Heredado de ConfigurationElementCollection) |
| Item[ConfigurationProperty] |
Obtiene o establece una propiedad o atributo de este elemento de configuración. (Heredado de ConfigurationElement) |
| Item[Int32] |
Obtiene o establece el ProfilePropertySettings objeto en la ubicación de índice especificada. (Heredado de ProfilePropertySettingsCollection) |
| Item[String] |
Obtiene o establece el ProfilePropertySettings objeto con el nombre especificado. (Heredado de ProfilePropertySettingsCollection) |
| LockAllAttributesExcept |
Obtiene la colección de atributos bloqueados. (Heredado de ConfigurationElement) |
| LockAllElementsExcept |
Obtiene la colección de elementos bloqueados. (Heredado de ConfigurationElement) |
| LockAttributes |
Obtiene la colección de atributos bloqueados. (Heredado de ConfigurationElement) |
| LockElements |
Obtiene la colección de elementos bloqueados. (Heredado de ConfigurationElement) |
| LockItem |
Obtiene o establece un valor que indica si el elemento está bloqueado. (Heredado de ConfigurationElement) |
| Properties |
Obtiene una colección de propiedades de configuración. (Heredado de ProfilePropertySettingsCollection) |
| RemoveElementName |
Obtiene o establece el nombre del ConfigurationElement objeto que se va a asociar a la operación remove en cuando ConfigurationElementCollection se reemplaza en una clase derivada. (Heredado de ConfigurationElementCollection) |
| SyncRoot |
Obtiene un objeto utilizado para sincronizar el acceso a .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| ThrowOnDuplicate |
Obtiene un valor que indica si se debe producir un error si se realiza un intento de crear un objeto duplicado. (Heredado de ProfilePropertySettingsCollection) |
Métodos
| Nombre | Description |
|---|---|
| Add(ProfilePropertySettings) |
Agrega un ProfilePropertySettings objeto a la colección. (Heredado de ProfilePropertySettingsCollection) |
| BaseAdd(ConfigurationElement, Boolean) |
Agrega un elemento de configuración a la colección de elementos de configuración. (Heredado de ConfigurationElementCollection) |
| BaseAdd(ConfigurationElement) |
Agrega un elemento de configuración a .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| BaseAdd(Int32, ConfigurationElement) |
Agrega un elemento de configuración a la colección de elementos de configuración. (Heredado de ConfigurationElementCollection) |
| BaseClear() |
Quita todos los objetos de elemento de configuración de la colección. (Heredado de ConfigurationElementCollection) |
| BaseGet(Int32) |
Obtiene el elemento de configuración en la ubicación de índice especificada. (Heredado de ConfigurationElementCollection) |
| BaseGet(Object) |
Devuelve el elemento de configuración con la clave especificada. (Heredado de ConfigurationElementCollection) |
| BaseGetAllKeys() |
Devuelve una matriz de las claves para todos los elementos de configuración contenidos en .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| BaseGetKey(Int32) |
Obtiene la clave de en ConfigurationElement la ubicación de índice especificada. (Heredado de ConfigurationElementCollection) |
| BaseIndexOf(ConfigurationElement) |
Indica el índice del especificado ConfigurationElement. (Heredado de ConfigurationElementCollection) |
| BaseIsRemoved(Object) |
Indica si el ConfigurationElement objeto con la clave especificada se ha quitado de .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| BaseRemove(Object) |
Quita un ConfigurationElement elemento de la colección. (Heredado de ConfigurationElementCollection) |
| BaseRemoveAt(Int32) |
Quita en ConfigurationElement la ubicación de índice especificada. (Heredado de ConfigurationElementCollection) |
| Clear() |
Quita todos los ProfilePropertySettings objetos de la colección. (Heredado de ProfilePropertySettingsCollection) |
| CopyTo(ConfigurationElement[], Int32) |
Copia el contenido de en ConfigurationElementCollection una matriz. (Heredado de ConfigurationElementCollection) |
| CreateNewElement() |
Cuando se reemplaza en una clase derivada, crea un nuevo ConfigurationElement. (Heredado de ProfilePropertySettingsCollection) |
| CreateNewElement(String) |
Crea un nuevo ConfigurationElement cuando se invalida en una clase derivada. (Heredado de ConfigurationElementCollection) |
| DeserializeElement(XmlReader, Boolean) |
Lee XML del archivo de configuración. (Heredado de ConfigurationElement) |
| Equals(Object) |
Compara el objeto actual RootProfilePropertySettingsCollection con otro objeto A RootProfilePropertySettingsCollection . |
| Get(Int32) |
Devuelve el ProfileSection objeto en el índice especificado. (Heredado de ProfilePropertySettingsCollection) |
| Get(String) |
Devuelve el ProfileSection objeto con el nombre especificado. (Heredado de ProfilePropertySettingsCollection) |
| GetElementKey(ConfigurationElement) |
Obtiene la clave del elemento de configuración especificado. (Heredado de ProfilePropertySettingsCollection) |
| GetEnumerator() |
Obtiene un IEnumerator objeto que se usa para recorrer en iteración .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| GetHashCode() |
Genera un código hash para la colección. |
| GetKey(Int32) |
Obtiene el nombre de en ProfilePropertySettings la ubicación de índice especificada. (Heredado de ProfilePropertySettingsCollection) |
| GetTransformedAssemblyString(String) |
Devuelve la versión transformada del nombre de ensamblado especificado. (Heredado de ConfigurationElement) |
| GetTransformedTypeString(String) |
Devuelve la versión transformada del nombre de tipo especificado. (Heredado de ConfigurationElement) |
| GetType() |
Obtiene el Type de la instancia actual. (Heredado de Object) |
| IndexOf(ProfilePropertySettings) |
Devuelve el índice del objeto especificado ProfilePropertySettings . (Heredado de ProfilePropertySettingsCollection) |
| Init() |
Establece el ConfigurationElement objeto en su estado inicial. (Heredado de ConfigurationElement) |
| InitializeDefault() |
Se usa para inicializar un conjunto predeterminado de valores para el ConfigurationElement objeto . (Heredado de ConfigurationElement) |
| IsElementName(String) |
Indica si el especificado ConfigurationElement existe en .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| IsElementRemovable(ConfigurationElement) |
Indica si el objeto especificado ConfigurationElement se puede quitar de .ConfigurationElementCollection (Heredado de ConfigurationElementCollection) |
| IsModified() |
Indica si ConfigurationElementCollection se ha modificado desde que se guardó o cargó por última vez cuando se invalidó en una clase derivada. (Heredado de ConfigurationElementCollection) |
| IsReadOnly() |
Indica si el ConfigurationElementCollection objeto es de solo lectura. (Heredado de ConfigurationElementCollection) |
| ListErrors(IList) |
Agrega los errores de propiedad no válida en este ConfigurationElement objeto y, en todos los subelementos, a la lista pasada. (Heredado de ConfigurationElement) |
| MemberwiseClone() |
Crea una copia superficial del Objectactual. (Heredado de Object) |
| OnDeserializeUnrecognizedAttribute(String, String) |
Obtiene un valor que indica si se encuentra un atributo desconocido durante la deserialización. (Heredado de ConfigurationElement) |
| OnDeserializeUnrecognizedElement(String, XmlReader) |
Controla la lectura de elementos de configuración no reconocidos de un archivo de configuración y hace que el sistema de configuración produzca una excepción si no se puede controlar el elemento. (Heredado de ProfilePropertySettingsCollection) |
| OnRequiredPropertyNotFound(String) |
Produce una excepción cuando no se encuentra una propiedad necesaria. (Heredado de ConfigurationElement) |
| PostDeserialize() |
Se llama después de la deserialización. (Heredado de ConfigurationElement) |
| PreSerialize(XmlWriter) |
Se llama antes de la serialización. (Heredado de ConfigurationElement) |
| Remove(String) |
Quita un ProfilePropertySettings objeto de la colección. (Heredado de ProfilePropertySettingsCollection) |
| RemoveAt(Int32) |
Quita un ProfilePropertySettings objeto en la ubicación de índice especificada de la colección. (Heredado de ProfilePropertySettingsCollection) |
| Reset(ConfigurationElement) |
Restablece a ConfigurationElementCollection su estado sin modificar cuando se invalida en una clase derivada. (Heredado de ConfigurationElementCollection) |
| ResetModified() |
Restablece el valor de la IsModified() propiedad a |
| SerializeElement(XmlWriter, Boolean) |
Escribe los datos de configuración en un elemento XML del archivo de configuración cuando se invalida en una clase derivada. (Heredado de ConfigurationElementCollection) |
| SerializeToXmlElement(XmlWriter, String) |
Escribe las etiquetas externas de este elemento de configuración en el archivo de configuración cuando se implementa en una clase derivada. (Heredado de ConfigurationElement) |
| Set(ProfilePropertySettings) |
Agrega el objeto especificado ProfilePropertySettings a la colección. (Heredado de ProfilePropertySettingsCollection) |
| SetPropertyValue(ConfigurationProperty, Object, Boolean) |
Establece una propiedad en el valor especificado. (Heredado de ConfigurationElement) |
| SetReadOnly() |
Establece la IsReadOnly() propiedad para el ConfigurationElementCollection objeto y para todos los subelementos. (Heredado de ConfigurationElementCollection) |
| ToString() |
Devuelve una cadena que representa el objeto actual. (Heredado de Object) |
| Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode) |
Invierte el efecto de combinar información de configuración de diferentes niveles de la jerarquía de configuración. (Heredado de ConfigurationElementCollection) |
Implementaciones de interfaz explícitas
| Nombre | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Copia en ConfigurationElementCollection una matriz. (Heredado de ConfigurationElementCollection) |
Métodos de extensión
| Nombre | Description |
|---|---|
| AsParallel(IEnumerable) |
Habilita la paralelización de una consulta. |
| AsQueryable(IEnumerable) |
Convierte un IEnumerable en un IQueryable. |
| Cast<TResult>(IEnumerable) |
Convierte los elementos de un IEnumerable al tipo especificado. |
| OfType<TResult>(IEnumerable) |
Filtra los elementos de un IEnumerable en función de un tipo especificado. |