Compartir a través de


RootProfilePropertySettingsCollection Clase

Definición

Actúa como parte superior de una jerarquía con nombre de dos niveles de las colecciones ProfilePropertySettingsCollection.

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
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 de las cuales 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 ASP.NET Propiedades del perfil.

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

RootProfilePropertySettingsCollection()

Inicializa una nueva instancia de la clase RootProfilePropertySettingsCollection usando la configuración predeterminada.

Propiedades

AddElementName

Obtiene o establece el nombre del objeto ConfigurationElement que se va a asociar a la operación de adición en la colección ConfigurationElementCollection cuando se reemplaza en una clase derivada.

(Heredado de ConfigurationElementCollection)
AllKeys

Devuelve una matriz que contiene los nombres de todos los objetos ProfileSection contenidos en la colección.

(Heredado de ProfilePropertySettingsCollection)
AllowClear

Obtiene un valor que indica si el elemento <clear> es válido como un objeto ProfilePropertySettings.

(Heredado de ProfilePropertySettingsCollection)
ClearElementName

Obtiene o establece el nombre del objeto ConfigurationElement que se va a asociar a la operación de borrado en la colección ConfigurationElementCollection cuando se reemplaza 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 Configuration de nivel superior que representa la jerarquía de configuración a la que pertenece la instancia actual de ConfigurationElement.

(Heredado de ConfigurationElement)
ElementInformation

Obtiene un objeto ElementInformation que contiene la funcionalidad e información no personalizable del objeto ConfigurationElement.

(Heredado de ConfigurationElement)
ElementName

Obtiene el nombre que se utiliza 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 objeto ConfigurationElementProperty que representa al propio objeto ConfigurationElement.

(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 una colección ProfileGroupSettingsCollection que contiene un conjunto de objetos ProfileGroupSettings.

HasContext

Obtiene un valor que indica si la propiedad CurrentConfiguration es null.

(Heredado de ConfigurationElement)
IsSynchronized

Obtiene un valor que indica si se sincroniza el acceso a la recopilació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 objeto ProfilePropertySettings situado en la ubicación de índice especificada.

(Heredado de ProfilePropertySettingsCollection)
Item[String]

Obtiene o establece el objeto ProfilePropertySettings 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 objeto ConfigurationElement que se va a asociar a la operación de eliminación en la colección ConfigurationElementCollection cuando se reemplaza en una clase derivada.

(Heredado de ConfigurationElementCollection)
SyncRoot

Obtiene un objeto que se utiliza para sincronizar el acceso a la colección ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
ThrowOnDuplicate

Obtiene un valor que indica si se debe producir un error ante un intento de creación de un objeto duplicado.

(Heredado de ProfilePropertySettingsCollection)

Métodos

Add(ProfilePropertySettings)

Agrega un objeto ProfilePropertySettings a la colección.

(Heredado de ProfilePropertySettingsCollection)
BaseAdd(ConfigurationElement)

Agrega un elemento de configuración a la colección ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Agrega un elemento de configuración a la colección de elementos de configuración.

(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 claves para todos los elementos de configuración incluidos en la colección ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
BaseGetKey(Int32)

Obtiene la clave para el objeto ConfigurationElement en la ubicación de índice especificada.

(Heredado de ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Indica el índice del objeto ConfigurationElement especificado.

(Heredado de ConfigurationElementCollection)
BaseIsRemoved(Object)

Indica si el objeto ConfigurationElement con la clave especificada se ha quitado de la colección ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
BaseRemove(Object)

Quita una clase ConfigurationElement de la colección.

(Heredado de ConfigurationElementCollection)
BaseRemoveAt(Int32)

Quita el objeto ConfigurationElement en la ubicación de índice especificada.

(Heredado de ConfigurationElementCollection)
Clear()

Quita todos los objetos ProfilePropertySettings de la colección.

(Heredado de ProfilePropertySettingsCollection)
CopyTo(ConfigurationElement[], Int32)

Copia el contenido de la colección ConfigurationElementCollection en una matriz.

(Heredado de ConfigurationElementCollection)
CreateNewElement()

Cuando se reemplaza en una clase derivada, se crea un nuevo objeto ConfigurationElement.

(Heredado de ProfilePropertySettingsCollection)
CreateNewElement(String)

Crea un nuevo objeto ConfigurationElement cuando se reemplaza 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 RootProfilePropertySettingsCollection actual con otro objeto RootProfilePropertySettingsCollection.

Get(Int32)

Devuelve el objeto ProfileSection situado en el índice especificado.

(Heredado de ProfilePropertySettingsCollection)
Get(String)

Devuelve el objeto ProfileSection con el nombre especificado.

(Heredado de ProfilePropertySettingsCollection)
GetElementKey(ConfigurationElement)

Obtiene la clave para el elemento de configuración especificado.

(Heredado de ProfilePropertySettingsCollection)
GetEnumerator()

Obtiene una interfaz IEnumerator que se utiliza para recorrer en iteración la colección ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
GetHashCode()

Genera un código hash para la colección.

GetKey(Int32)

Obtiene el nombre de ProfilePropertySettings en 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 ProfilePropertySettings especificado.

(Heredado de ProfilePropertySettingsCollection)
Init()

Establece el objeto ConfigurationElement en su estado inicial.

(Heredado de ConfigurationElement)
InitializeDefault()

Se utiliza para inicializar un conjunto predeterminado de valores para el objeto ConfigurationElement.

(Heredado de ConfigurationElement)
IsElementName(String)

Indica si el objeto ConfigurationElement especificado existe en la colección ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Indica si la ConfigurationElement se puede quitar de ConfigurationElementCollection.

(Heredado de ConfigurationElementCollection)
IsModified()

Indica si se ha modificado esta colección ConfigurationElementCollection desde la última vez en que se guardo o cargó al reemplazarla en una clase derivada.

(Heredado de ConfigurationElementCollection)
IsReadOnly()

Indica si la el objeto ConfigurationElementCollection es de solo lectura.

(Heredado de ConfigurationElementCollection)
ListErrors(IList)

Agrega a la lista que se pasa los errores de propiedad no válida que hay en este objeto ConfigurationElement y en todos los subelementos.

(Heredado de ConfigurationElement)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
OnDeserializeUnrecognizedAttribute(String, String)

Obtiene un valor que indica si se ha encontrado un atributo desconocido durante la deserialización.

(Heredado de ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Controla la lectura de elementos de configuración no reconocidos desde un archivo de configuración y hace que el sistema de configuración produzca una excepción si el elemento no se puede controlar.

(Heredado de ProfilePropertySettingsCollection)
OnRequiredPropertyNotFound(String)

Se inicia una excepción cuando no se encuentra una propiedad necesaria.

(Heredado de ConfigurationElement)
PostDeserialize()

Se llama a este método después de la deserialización.

(Heredado de ConfigurationElement)
PreSerialize(XmlWriter)

Se llama a este método antes de la serialización.

(Heredado de ConfigurationElement)
Remove(String)

Quita un objeto ProfilePropertySettings de la colección.

(Heredado de ProfilePropertySettingsCollection)
RemoveAt(Int32)

Quita un objeto ProfilePropertySettings de la colección en el índice especificado.

(Heredado de ProfilePropertySettingsCollection)
Reset(ConfigurationElement)

Restablece la colección ConfigurationElementCollection a su estado sin modificaciones cuando se reemplaza en una clase derivada.

(Heredado de ConfigurationElementCollection)
ResetModified()

Restablece el valor de la propiedad IsModified() en false cuando se invalida en una clase derivada.

(Heredado de ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Escribe los datos de configuración en un elemento XML del archivo de configuración cuando se reemplaza 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 a la colección el objeto ProfilePropertySettings especificado.

(Heredado de ProfilePropertySettingsCollection)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Establece una propiedad en el valor especificado.

(Heredado de ConfigurationElement)
SetReadOnly()

Establece la propiedad IsReadOnly() para el objeto ConfigurationElementCollection 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 la información de configuración de distintos niveles de la jerarquía de configuración.

(Heredado de ConfigurationElementCollection)

Implementaciones de interfaz explícitas

ICollection.CopyTo(Array, Int32)

Copia la colección ConfigurationElementCollection en una matriz.

(Heredado de ConfigurationElementCollection)

Métodos de extensión

Cast<TResult>(IEnumerable)

Convierte los elementos de IEnumerable en el tipo especificado.

OfType<TResult>(IEnumerable)

Filtra los elementos de IEnumerable en función de un tipo especificado.

AsParallel(IEnumerable)

Habilita la paralelización de una consulta.

AsQueryable(IEnumerable)

Convierte una interfaz IEnumerable en IQueryable.

Se aplica a

Consulte también